summaryrefslogtreecommitdiff
path: root/indra/llrender/llvertexbuffer.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-01-11 00:04:41 -0600
committerDave Parks <davep@lindenlab.com>2023-01-11 00:04:41 -0600
commit3ac990e6ce962c2530a902d14a711d1ee996375c (patch)
tree6c40656643f2a682442a9dba41a55f2fb373b082 /indra/llrender/llvertexbuffer.cpp
parent493d501cde13abf1ac4164cd77286f068da3a62c (diff)
SL-18869 Touch up -- fix some Debug GL assertions and restore shadows.
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
-rw-r--r--indra/llrender/llvertexbuffer.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 0dce5ed3a3..e1352691d4 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -560,10 +560,8 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
U16* idx = ((U16*) getIndicesPointer())+indices_offset;
- stop_glerror();
glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT,
idx);
- stop_glerror();
}
void LLVertexBuffer::drawRangeFast(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const
@@ -605,10 +603,8 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
return;
}
- stop_glerror();
- glDrawElements(sGLMode[mode], count, GL_UNSIGNED_SHORT,
+ glDrawElements(sGLMode[mode], count, GL_UNSIGNED_SHORT,
((U16*) getIndicesPointer()) + indices_offset);
- stop_glerror();
}
@@ -888,6 +884,7 @@ void LLVertexBuffer::genBuffer(U32 size)
glBindBuffer(GL_ARRAY_BUFFER, mGLBuffer);
glBufferData(GL_ARRAY_BUFFER, mSize, nullptr, mUsage);
glBindBuffer(GL_ARRAY_BUFFER, 0);
+ sGLRenderBuffer = 0;
sGLCount++;
}
@@ -904,6 +901,7 @@ void LLVertexBuffer::genIndices(U32 size)
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mGLIndices);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, mIndicesSize, nullptr, mUsage);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+ sGLRenderIndices = 0;
sGLCount++;
}
@@ -1293,17 +1291,6 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
sMappedCount++;
stop_glerror();
- if (gDebugGL && useVBOs())
- {
- GLint elem = 0;
- glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &elem);
-
- if (elem != mGLIndices)
- {
- LL_ERRS() << "Wrong index buffer bound!" << LL_ENDL;
- }
- }
-
map_range = false;
}
@@ -1337,6 +1324,7 @@ static void flush_vbo(GLenum target, S32 start, S32 end, void* data)
for (S32 i = start; i < end; i += block_size)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("glBufferSubData block");
+ LL_PROFILE_GPU_ZONE("glBufferSubData");
S32 tend = llmin(i + block_size, end);
glBufferSubData(target, i, tend - i, (U8*) data + (i-start));
}