Skip to content
Permalink
Browse files
Merge pull request #6437 from stenzek/gl-element-buffer-binding
OGL: Ensure VAO is active before unmapping buffers
  • Loading branch information
stenzek committed Mar 14, 2018
2 parents 6813c5e + dc9012a commit b3f9488
Showing 1 changed file with 4 additions and 0 deletions.
@@ -86,6 +86,10 @@ void VertexManager::PrepareDrawBuffers(u32 stride)
u32 vertex_data_size = IndexGenerator::GetNumVerts() * stride;
u32 index_data_size = IndexGenerator::GetIndexLen() * sizeof(u16);

// The index buffer is part of the VAO state, therefore we need to bind it first.
const GLVertexFormat* vertex_format =
static_cast<GLVertexFormat*>(VertexLoaderManager::GetCurrentVertexFormat());
ProgramShaderCache::BindVertexFormat(vertex_format);
s_vertexBuffer->Unmap(vertex_data_size);
s_indexBuffer->Unmap(index_data_size);

0 comments on commit b3f9488

Please sign in to comment.