summaryrefslogtreecommitdiff
path: root/indra/newview/llvotree.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/llvotree.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/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;