Skip to content
Snippets Groups Projects
Commit 4341a802 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Clean up some issues with resetting vertex buffers

parent ba307925
No related branches found
No related tags found
No related merge requests found
......@@ -1141,7 +1141,7 @@ LLRender::~LLRender()
void LLRender::init()
{
if (mDummyVAO != 0)
{ //bind a dummy vertex array object so we're core profile compliant
{
#ifdef GL_ARB_vertex_array_object
glDeleteVertexArrays(1, &mDummyVAO);
#endif
......
......@@ -1452,6 +1452,10 @@ class LLOctreeDirty : public OctreeTraveler
{
continue;
}
if (drawable->getVObj().notNull())
{
drawable->getVObj()->resetVertexBuffers();
}
if (!mNoRebuild && drawable->getVObj().notNull() && !group->getSpatialPartition()->mRenderByGroup)
{
gPipeline.markRebuild(drawable, LLDrawable::REBUILD_ALL, TRUE);
......
......@@ -144,6 +144,7 @@ class LLViewerObject
LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp, BOOL is_global = FALSE);
virtual void resetVertexBuffers() {}
virtual void markDead(); // Mark this object as dead, and clean up its references
BOOL isDead() const {return mDead;}
BOOL isOrphaned() const { return mOrphaned; }
......
......@@ -480,6 +480,11 @@ const S32 LEAF_VERTICES = 16;
static LLTrace::BlockTimerStatHandle FTM_UPDATE_TREE("Update Tree");
void LLVOTree::resetVertexBuffers()
{
mReferenceBuffer = NULL;
}
BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
{
LL_RECORD_BLOCK_TIME(FTM_UPDATE_TREE);
......
......@@ -57,19 +57,20 @@ class LLVOTree final : public LLViewerObject
/*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
U32 block_num, const EObjectUpdateType update_type,
LLDataPacker *dp);
/*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time);
LLDataPacker *dp) override;
/*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) override;
// Graphical stuff for objects - maybe broken out into render class later?
/*virtual*/ void render(LLAgent &agent);
/*virtual*/ void setPixelAreaAndAngle(LLAgent &agent);
/*virtual*/ void updateTextures();
/*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) override;
/*virtual*/ void updateTextures() override;
/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
/*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
/*virtual*/ void updateSpatialExtents(LLVector4a &min, LLVector4a &max);
/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override;
/*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override;
/*virtual*/ void updateSpatialExtents(LLVector4a &min, LLVector4a &max) override;
virtual U32 getPartitionType() const;
void resetVertexBuffers() override;
U32 getPartitionType() const override;
void updateRadius();
......
......@@ -7362,6 +7362,8 @@ void LLPipeline::doResetVertexBuffers(bool forced)
LL_RECORD_BLOCK_TIME(FTM_RESET_VB);
mResetVertexBuffers = false;
mDeferredVB = NULL;
mCubeVB = NULL;
for (LLViewerRegion* region : LLWorld::getInstance()->getRegionList())
......@@ -7422,6 +7424,16 @@ void LLPipeline::doResetVertexBuffers(bool forced)
LLVOPartGroup::restoreGL();
gGL.restoreVertexBuffers();
if (mCubeVB.isNull())
{
mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW);
}
mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0);
mDeferredVB->allocateBuffer(8, 0, true);
}
void LLPipeline::renderObjects(U32 type, U32 mask, bool texture, bool batch_texture)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment