summaryrefslogtreecommitdiff
path: root/indra/newview/llvotree.cpp
diff options
context:
space:
mode:
authorcallum_linden <callum@lindenlab.com>2017-11-30 14:44:44 -0800
committercallum_linden <callum@lindenlab.com>2017-11-30 14:44:44 -0800
commitdd0d2805e2b495246525f49325c4492b7b57f157 (patch)
tree96ae78468bbe760c4934416764a4cd89cf5ae381 /indra/newview/llvotree.cpp
parent2e3c5ac88a434ee437bc3e68b321d5bd0bcd7cc9 (diff)
parente3a2c5e3217ae74a0277f2e6d4e1e708fe398a1c (diff)
Automated erge with tip of viewer64
Diffstat (limited to 'indra/newview/llvotree.cpp')
-rw-r--r--indra/newview/llvotree.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 4dcc267e96..369ddebe2d 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -525,7 +525,14 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
}
mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, 0);
- mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE);
+ if (!mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE))
+ {
+ LL_WARNS() << "Failed to allocate Vertex Buffer on update to "
+ << max_vertices << " vertices and "
+ << max_indices << " indices" << LL_ENDL;
+ mReferenceBuffer = NULL; //unref
+ return TRUE;
+ }
LLStrider<LLVector3> vertices;
LLStrider<LLVector3> normals;
@@ -883,7 +890,21 @@ void LLVOTree::updateMesh()
LLFace* facep = mDrawable->getFace(0);
if (!facep) return;
LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
- buff->allocateBuffer(vert_count, index_count, TRUE);
+ if (!buff->allocateBuffer(vert_count, index_count, TRUE))
+ {
+ LL_WARNS() << "Failed to allocate Vertex Buffer on mesh update to "
+ << vert_count << " vertices and "
+ << index_count << " indices" << LL_ENDL;
+ buff->allocateBuffer(1, 3, true);
+ memset((U8*)buff->getMappedData(), 0, buff->getSize());
+ memset((U8*)buff->getMappedIndices(), 0, buff->getIndicesSize());
+ facep->setSize(1, 3);
+ facep->setVertexBuffer(buff);
+ mReferenceBuffer->flush();
+ buff->flush();
+ return;
+ }
+
facep->setVertexBuffer(buff);
LLStrider<LLVector3> vertices;