diff options
| author | Stenzek <stenzek@users.noreply.github.com> | 2018-03-15 00:47:50 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-15 00:47:50 +1000 |
| commit | b3f948891a9336ec7b8f18bda1f83e5b72d70709 (patch) | |
| tree | ca3defc510fc2078f365d9b9193887e5d2efeef0 /Source/Core/VideoBackends/OGL/VertexManager.cpp | |
| parent | 6813c5e1e946fda239d1769a3893099357c5274c (diff) | |
| parent | dc9012ae086629207ae225e1e1d40a96607c1bca (diff) | |
Merge pull request #6437 from stenzek/gl-element-buffer-binding
OGL: Ensure VAO is active before unmapping buffers
Diffstat (limited to 'Source/Core/VideoBackends/OGL/VertexManager.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/VertexManager.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/OGL/VertexManager.cpp b/Source/Core/VideoBackends/OGL/VertexManager.cpp index 00b20e3c76..00cf6b3cfa 100644 --- a/Source/Core/VideoBackends/OGL/VertexManager.cpp +++ b/Source/Core/VideoBackends/OGL/VertexManager.cpp @@ -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); |
