mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-09-10 04:16:36 -05:00
OGL: Track state of last bound vertex array object
This reduces the overhead of calling glBindVertexArray() every time RestoreAPIState() is called, even when it is redundant.
This commit is contained in:
@@ -95,6 +95,11 @@ void VertexManager::ResetBuffer(u32 stride)
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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);
|
||||
|
||||
auto buffer = s_vertexBuffer->Map(MAXVBUFFERSIZE, stride);
|
||||
m_cur_buffer_pointer = m_base_buffer_pointer = buffer.first;
|
||||
m_end_buffer_pointer = buffer.first + MAXVBUFFERSIZE;
|
||||
|
||||
Reference in New Issue
Block a user