Recreate mDeferredVB on vertexbuffer reset.
Shuffled some code from LLVOPartGroup::restoreGL() to LLVOPartGroup::destroyGL(), as it makes more sense there. Bind the correct shader in wireframe.. glLineStipple call managed to sneak into no-fixed-function mode. LLViewerWindow::initFonts was called frequently and redundantly during destroygl->restoregl transition.
This commit is contained in:
@@ -62,28 +62,6 @@ S32* LLVOPartGroup::sVBSlotCursor = NULL;
|
||||
//static
|
||||
void LLVOPartGroup::restoreGL()
|
||||
{
|
||||
//Just iterate over all particle faces and mark their vbo index as 'uninitialized' since sVBSlotFree & sVBSlotCursor will be clobbered.
|
||||
for (int i=0; i<gObjectList.getNumObjects(); i++)
|
||||
{
|
||||
LLViewerObject *obj = gObjectList.getObject(i);
|
||||
if(obj && obj->mDrawable)
|
||||
{
|
||||
if (obj->mDrawable->getRenderType() == LLPipeline::RENDER_TYPE_PARTICLES ||
|
||||
obj->mDrawable->getRenderType() == LLPipeline::RENDER_TYPE_HUD_PARTICLES
|
||||
#if ENABLE_CLASSIC_CLOUDS
|
||||
|| obj->mDrawable->getRenderType() == LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS
|
||||
#endif
|
||||
)
|
||||
{
|
||||
for (S32 j = 0; j < obj->mDrawable->getNumFaces(); ++j)
|
||||
{
|
||||
LLFace* facep = obj->mDrawable->getFace(j);
|
||||
if(facep)
|
||||
facep->setIndicesIndex(0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i)
|
||||
{
|
||||
sVBSlotFree[i] = i;
|
||||
@@ -142,6 +120,32 @@ void LLVOPartGroup::restoreGL()
|
||||
//static
|
||||
void LLVOPartGroup::destroyGL()
|
||||
{
|
||||
//Just iterate over all particle faces and mark their vbo index as 'uninitialized' since sVBSlotFree & sVBSlotCursor will be clobbered.
|
||||
for (int i=0; i<gObjectList.getNumObjects(); i++)
|
||||
{
|
||||
LLViewerObject *obj = gObjectList.getObject(i);
|
||||
if(obj && obj->mDrawable)
|
||||
{
|
||||
if (obj->mDrawable->getRenderType() == LLPipeline::RENDER_TYPE_PARTICLES ||
|
||||
obj->mDrawable->getRenderType() == LLPipeline::RENDER_TYPE_HUD_PARTICLES
|
||||
#if ENABLE_CLASSIC_CLOUDS
|
||||
|| obj->mDrawable->getRenderType() == LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS
|
||||
#endif
|
||||
)
|
||||
{
|
||||
for (S32 j = 0; j < obj->mDrawable->getNumFaces(); ++j)
|
||||
{
|
||||
LLFace* facep = obj->mDrawable->getFace(j);
|
||||
if(facep)
|
||||
facep->setIndicesIndex(0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i)
|
||||
{
|
||||
sVBSlotFree[i] = i;
|
||||
}
|
||||
sVB = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user