If queried buffer size&offset are 0, don't bind with range. Closes #1461

This commit is contained in:
baldurk
2019-07-22 19:57:14 +01:00
parent 98e93d282d
commit 7478bda617
+7 -2
View File
@@ -1094,8 +1094,13 @@ void GLPushPopState::Pop(bool modern)
if(modern)
{
for(size_t i = 0; i < ARRAY_COUNT(idxubo); i++)
GL.glBindBufferRange(eGL_UNIFORM_BUFFER, (GLuint)i, idxubo[i].buf, (GLintptr)idxubo[i].offs,
(GLsizeiptr)idxubo[i].size);
{
if(idxubo[i].offs == 0 && idxubo[i].size == 0)
GL.glBindBufferBase(eGL_UNIFORM_BUFFER, (GLuint)i, idxubo[i].buf);
else
GL.glBindBufferRange(eGL_UNIFORM_BUFFER, (GLuint)i, idxubo[i].buf, (GLintptr)idxubo[i].offs,
(GLsizeiptr)idxubo[i].size);
}
GL.glBindBuffer(eGL_UNIFORM_BUFFER, ubo);