mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 19:58:53 +00: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:
parent
fca9c28f38
commit
3fd4142f36
9 changed files with 59 additions and 29 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue