diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-11-29 23:40:12 +0000 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-11-29 23:40:12 +0000 |
commit | 5c7f27562dc1ef449f23be5ab747a19c23eec361 (patch) | |
tree | 658416eb1f85eaa96dbc9a4a9762b0029e520476 /indra/newview/llspatialpartition.cpp | |
parent | 84b6bce4ee9299454aca75d8f876b6582b756ff6 (diff) | |
parent | 1693ccba58eef676df1f91e50627545ac35bb819 (diff) |
merge
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 0db1806fd8..b4116026fa 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); |