From c1727e9035789a7e6c8037c76b85117678faab03 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 30 Dec 2014 23:49:44 +0000 Subject: [PATCH] Don't initialise VAO if attribs have invalid parameters * Technically we need to try and restore the VAOs even if disabled to the correct setup, so that if they're just enabled they are in the expected state. However if the attribs are in an invalid state it's not legal to just enable them again, so they need to be respecified anyway. * This might have something to do with compatibility profiles - it was seen capturing Wolfenstein: The New Order, which runs 3.2 compatibility. --- renderdoc/driver/gl/gl_manager.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/renderdoc/driver/gl/gl_manager.cpp b/renderdoc/driver/gl/gl_manager.cpp index 63697e02c..33b0dd6fa 100644 --- a/renderdoc/driver/gl/gl_manager.cpp +++ b/renderdoc/driver/gl/gl_manager.cpp @@ -1387,10 +1387,13 @@ void GLResourceManager::Apply_InitialState(GLResource live, InitialContentData i gl.glVertexAttribBinding(i, attrib.vbslot); - if(initialdata->VertexAttribs[i].integer == 0) - gl.glVertexAttribFormat(i, attrib.size, attrib.type, (GLboolean)attrib.normalized, attrib.offset); - else - gl.glVertexAttribIFormat(i, attrib.size, attrib.type, attrib.offset); + if(attrib.size != 0) + { + if(initialdata->VertexAttribs[i].integer == 0) + gl.glVertexAttribFormat(i, attrib.size, attrib.type, (GLboolean)attrib.normalized, attrib.offset); + else + gl.glVertexAttribIFormat(i, attrib.size, attrib.type, attrib.offset); + } VertexBufferInitialData &buf = initialdata->VertexBuffers[i];