Don't trash state of uniform buffer offset & size in GLPushPopState

This commit is contained in:
baldurk committed 2019-01-16 12:02:30 +00:00
1 parent 62a5e6e8bd
commit c4f1062cdd
2 files changed
+15 -7

No files matched your search

+9 -6
View File
@@ -944,9 +944,12 @@ void GLPushPopState::Push(bool modern)
// the non-indexed bind is separate from the indexed binds
GL.glGetIntegerv(eGL_UNIFORM_BUFFER_BINDING, (GLint *)&ubo);
GL.glGetIntegeri_v(eGL_UNIFORM_BUFFER_BINDING, 0, (GLint *)&idxubo[0]);
GL.glGetIntegeri_v(eGL_UNIFORM_BUFFER_BINDING, 1, (GLint *)&idxubo[1]);
GL.glGetIntegeri_v(eGL_UNIFORM_BUFFER_BINDING, 2, (GLint *)&idxubo[2]);
for(size_t i = 0; i < ARRAY_COUNT(idxubo); i++)
{
GL.glGetIntegeri_v(eGL_UNIFORM_BUFFER_BINDING, (GLuint)i, (GLint *)&idxubo[i].buf);
GL.glGetInteger64i_v(eGL_UNIFORM_BUFFER_START, (GLuint)i, (GLint64 *)&idxubo[i].offs);
GL.glGetInteger64i_v(eGL_UNIFORM_BUFFER_SIZE, (GLuint)i, (GLint64 *)&idxubo[i].size);
}
GL.glGetIntegerv(eGL_VERTEX_ARRAY_BINDING, (GLint *)&VAO);
}
@@ -1083,9 +1086,9 @@ void GLPushPopState::Pop(bool modern)
if(modern)
{
GL.glBindBufferBase(eGL_UNIFORM_BUFFER, 0, idxubo[0]);
GL.glBindBufferBase(eGL_UNIFORM_BUFFER, 1, idxubo[1]);
GL.glBindBufferBase(eGL_UNIFORM_BUFFER, 2, idxubo[2]);
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);
GL.glBindBuffer(eGL_UNIFORM_BUFFER, ubo);
+6 -1
View File
@@ -432,7 +432,12 @@ struct GLPushPopState
GLenum ActiveTexture;
GLuint tex0;
GLuint arraybuf;
GLuint idxubo[3];
struct IndexedBuffer
{
GLuint buf;
GLuint64 offs;
GLuint64 size;
} idxubo[3];
GLuint ubo;
GLuint prog;
GLuint pipe;