From fdcf2eda5a747ced5ed949bd99189ca595488941 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 15 May 2014 18:44:10 -0500 Subject: [PATCH] Decouple vbo validation from LLDrawInfo. Such required vbo's to be initialized before drawinfo creation/modification, which is no longer the case with llvovolume. ('RenderDelayVBUpdate'[although removed in Singu] also fails the same assumption.) --- indra/newview/llspatialpartition.cpp | 2 +- indra/newview/llvograss.cpp | 5 +++++ indra/newview/llvopartgroup.cpp | 5 +++++ indra/newview/llvovolume.cpp | 9 +++++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 9ad74f7a0..627df738a 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -4462,7 +4462,7 @@ LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, mAlphaMaskCutoff(0.5f), mDiffuseAlphaMode(0) { - mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset); + //mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset); mDebugColor = (rand() << 16) + rand(); } diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index f45fc6de2..9d802740f 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -777,6 +777,11 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) } } + if(vertex_count > 0) + { + buffer->validateRange(0, vertex_count - 1, index_count, 0); + } + buffer->flush(); mFaceList.clear(); } diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 09d2037e2..c1c57ab32 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -988,6 +988,11 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) //for alpha sorting facep->setDrawInfo(info); } + + if(facep->getGeomCount() > 0) + { + buffer->validateRange(facep->getGeomIndex(), facep->getGeomCount() - 1, facep->getIndicesCount(), 0); + } } mFaceList.clear(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c157cf236..b88b673f6 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4288,7 +4288,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, draw_vec[idx]->mTextureList.resize(index+1); draw_vec[idx]->mTextureList[index] = tex; } - draw_vec[idx]->validate(); + //draw_vec[idx]->validate(); update_min_max(draw_vec[idx]->mExtents[0], draw_vec[idx]->mExtents[1], facep->mExtents[0]); update_min_max(draw_vec[idx]->mExtents[0], draw_vec[idx]->mExtents[1], facep->mExtents[1]); } @@ -4372,7 +4372,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, draw_info->mTextureList[index] = tex; } - draw_info->validate(); + //draw_info->validate(); } } @@ -6352,6 +6352,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac ++face_iter; } + if(index_offset > 0) + { + buffer->validateRange(0, index_offset - 1, indices_index, 0); + } + buffer->flush(); }