From 6bcd293a3f775a17e7e7cf802e792dc23ac30e18 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 2 May 2017 22:56:55 +0100 Subject: [PATCH] Don't mutate VAO binding when replaying glEnable/DisableVertexAttrib * These calls need to go through DSA access like all the other VAO functions. --- .../driver/gl/wrappers/gl_buffer_funcs.cpp | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp index 9990caaa6..ce304824c 100644 --- a/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp @@ -3663,20 +3663,16 @@ bool WrappedOpenGL::Serialise_glEnableVertexArrayAttribEXT(GLuint vaobj, GLuint if(m_State < WRITING) { - if(m_State == READING) + if(id != ResourceId()) { - if(id != ResourceId()) - { - GLResource res = GetResourceManager()->GetLiveResource(id); - m_Real.glBindVertexArray(res.name); - } - else - { - m_Real.glBindVertexArray(m_FakeVAO); - } + vaobj = GetResourceManager()->GetLiveResource(id).name; + } + else + { + vaobj = m_FakeVAO; } - m_Real.glEnableVertexAttribArray(Index); + m_Real.glEnableVertexArrayAttribEXT(vaobj, Index); } return true; } @@ -3745,20 +3741,16 @@ bool WrappedOpenGL::Serialise_glDisableVertexArrayAttribEXT(GLuint vaobj, GLuint if(m_State < WRITING) { - if(m_State == READING) + if(id != ResourceId()) { - if(id != ResourceId()) - { - GLResource res = GetResourceManager()->GetLiveResource(id); - m_Real.glBindVertexArray(res.name); - } - else - { - m_Real.glBindVertexArray(m_FakeVAO); - } + vaobj = GetResourceManager()->GetLiveResource(id).name; + } + else + { + vaobj = m_FakeVAO; } - m_Real.glDisableVertexAttribArray(Index); + m_Real.glDisableVertexArrayAttribEXT(vaobj, Index); } return true; }