diff options
| author | callum_linden <callum@lindenlab.com> | 2017-11-30 14:44:44 -0800 |
|---|---|---|
| committer | callum_linden <callum@lindenlab.com> | 2017-11-30 14:44:44 -0800 |
| commit | dd0d2805e2b495246525f49325c4492b7b57f157 (patch) | |
| tree | 96ae78468bbe760c4934416764a4cd89cf5ae381 /indra/newview/llspatialpartition.cpp | |
| parent | 2e3c5ac88a434ee437bc3e68b321d5bd0bcd7cc9 (diff) | |
| parent | e3a2c5e3217ae74a0277f2e6d4e1e708fe398a1c (diff) | |
Automated erge with tip of viewer64
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 94b838e829..d2a87ee2af 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -448,16 +448,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); |
