summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-07-16 08:22:34 -0700
committerGraham Linden <graham@lindenlab.com>2019-07-16 08:22:34 -0700
commit5bae46b357cd4d7700ed4289fc3b3ddf00860ec9 (patch)
tree431cb0368a50499b1ee8b703192958510deed699 /indra
parentf6eab050178336a553f52837b8e8a4cc0bf6bacb (diff)
Add more asserts to try to catch 10761 before the driver kabooms.
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llvertexbuffer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 1b910d91b2..2ac17127be 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -660,6 +660,9 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_offset) const
{
+ llassert(start < (U32)mNumVerts);
+ llassert(end < (U32)mNumVerts);
+
if (start >= (U32) mNumVerts ||
end >= (U32) mNumVerts)
{
@@ -679,6 +682,9 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
U16* idx = ((U16*) getIndicesPointer())+indices_offset;
for (U32 i = 0; i < count; ++i)
{
+ llassert(idx[i] >= start);
+ llassert(idx[i] <= end);
+
if (idx[i] < start || idx[i] > end)
{
LL_ERRS() << "Index out of range: " << idx[i] << " not in [" << start << ", " << end << "]" << LL_ENDL;
@@ -697,6 +703,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
for (U32 i = start; i < end; i++)
{
S32 idx = (S32) (v[i][3]+0.25f);
+ llassert(idx >= 0);
if (idx < 0 || idx >= shader->mFeatures.mIndexedTextureChannels)
{
LL_ERRS() << "Bad texture index found in vertex data stream." << LL_ENDL;
@@ -754,6 +761,8 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
U16* idx = ((U16*) getIndicesPointer())+indices_offset;
+ llassert(idx);
+
stop_glerror();
LLGLSLShader::startProfile();
glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT,