summaryrefslogtreecommitdiff
path: root/indra/newview/llspatialpartition.cpp
diff options
context:
space:
mode:
authorcallum_linden <callum@lindenlab.com>2017-12-11 10:09:44 -0800
committercallum_linden <callum@lindenlab.com>2017-12-11 10:09:44 -0800
commit5561673bf1c98c717f69e747a9e8b0d56129ef12 (patch)
treef021c5beca7aaad132c60d25881c7920a9944daf /indra/newview/llspatialpartition.cpp
parentfe29551d9a6685bdc40e87ae135f236aec1ea475 (diff)
parentc565c62745ec37484118888f8f45dbde34d42e46 (diff)
Automated merge with tip of viewer64 *plus* update to CEF 3.3202.1686 / Dullahan 901
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rw-r--r--indra/newview/llspatialpartition.cpp20
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);