diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-11-01 19:36:13 +0200 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-11-01 19:36:13 +0200 |
commit | 149b2d88dd75bddf1cb3e9927c4e8fcc84e263e1 (patch) | |
tree | b02a4d2775cec34281b637a6f4d1ae0c40faa976 /indra/newview/llspatialpartition.cpp | |
parent | fec6bbddc371b2d1e0aa41d39a1b3dfaa8fb2016 (diff) |
MAINT-7228 Vertex buffer allocation failure handling
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rw-r--r-- | indra/newview/llspatialpartition.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 0fd36766b3..df5756cf11 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -451,16 +451,32 @@ void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group) (group->mBufferUsage != group->mVertexBuffer->getUsage() && LLVertexBuffer::sEnableVBOs)) { group->mVertexBuffer = createVertexBuffer(mVertexDataMask, group->mBufferUsage); - group->mVertexBuffer->allocateBuffer(vertex_count, index_count, true); + if (!group->mVertexBuffer->allocateBuffer(vertex_count, index_count, true)) + { + LL_WARNS() << "Failed to allocate Vertex Buffer on rebuild to " + << vertex_count << " vertices and " + << index_count << " indices" << LL_ENDL; + group->mVertexBuffer = NULL; + group->mBufferMap.clear(); + } stop_glerror(); } else { - group->mVertexBuffer->resizeBuffer(vertex_count, index_count); + if (!group->mVertexBuffer->resizeBuffer(vertex_count, index_count)) + { + // Is likely to cause a crash. If this gets triggered find a way to avoid it (don't forget to reset face) + LL_WARNS() << "Failed to resize Vertex Buffer on rebuild to " + << vertex_count << " vertices and " + << index_count << " indices" << LL_ENDL; + group->mVertexBuffer = NULL; + group->mBufferMap.clear(); + } stop_glerror(); } } + if (group->mVertexBuffer) { LL_RECORD_BLOCK_TIME(FTM_GET_GEOMETRY); getGeometry(group); |