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.
This commit is contained in:
baldurk
2014-12-30 23:49:44 +00:00
parent 29f7234219
commit c1727e9035
+7 -4
View File
@@ -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];