If we're retyping in BindBuffer(), remove any redundant BindBuffer()s

This commit is contained in:
baldurk committed 2014-12-26 12:21:43 +00:00
1 parent 3cec05c3d9
commit aec7af04e4
1 file changed
+18
@@ -174,6 +174,24 @@ void WrappedOpenGL::glBindBuffer(GLenum target, GLuint buffer)
if(r->datatype != target)
{
Chunk *chunk = NULL;
r->LockChunks();
while(true)
{
Chunk *end = r->GetLastChunk();
if(end->GetChunkType() == BIND_BUFFER)
{
SAFE_DELETE(end);
r->PopChunk();
continue;
}
break;
}
r->UnlockChunks();
{
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);