From caaba76921f266c0ecb13118b627a36cdf54bb19 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Mon, 26 Mar 2012 15:05:35 +0200 Subject: [PATCH] Firestorm workaround for alloc failure --- indra/llrender/llvertexbuffer.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index a2bfe13c3..a3b1b36af 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1210,8 +1210,13 @@ void LLVertexBuffer::updateNumVerts(S32 nverts) if (nverts >= 65535) { - llwarns << "Vertex buffer overflow!" << llendl; - nverts = 65535; + // FIRE-5077; Just print an info if there are more than 0xFFFF, for now just so there is a message in the logs where in older version #vertices would have been capped. + + // llwarns << "Vertex buffer overflow!" << llendl; + // nverts = 65535; + llinfos << "More vertices than 65535 (#" << nverts << ")" < } S32 needed_size = calcOffsets(mTypeMask, mOffsets, nverts); @@ -1250,11 +1255,21 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) stop_glerror(); - if (nverts < 0 || nindices < 0 || - nverts > 65536) - { + // FIRE-5077; Just print an info if there are more than 0xFFFF, for now just so there is a message in the logs where in older version #vertices would have been capped. + + // if (nverts < 0 || nindices < 0 || + // nverts > 65536) + // { + // llerrs << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl; + // } + + if( nverts < 0 || nindices < 0 ) llerrs << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl; - } + + if( nverts > 0xFFFF ) + llinfos << "More vertices than 65535 (#" << nverts << ")" < updateNumVerts(nverts); updateNumIndices(nindices);