summaryrefslogtreecommitdiff
path: root/indra/newview/llspatialpartition.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2017-11-29 11:31:08 -0800
committerOz Linden <oz@lindenlab.com>2017-11-29 11:31:08 -0800
commita12e282cd473d5b7fc3e23fdd8fdfed11cc88864 (patch)
treecf07df2ae2219009bdc8337f4f9b4f1247fbd65d /indra/newview/llspatialpartition.cpp
parent28f3b032076929bf595c34ab10666930c7ea1464 (diff)
parent1693ccba58eef676df1f91e50627545ac35bb819 (diff)
merge changes for 5.0.9-release
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 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);