mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-03 00:42:39 +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
|
@ -320,7 +320,7 @@ void TextureCache::ConvertTexture(TCacheEntry* destination, TCacheEntry* source,
|
|||
glBindTexture(GL_TEXTURE_BUFFER, m_palette_resolv_texture);
|
||||
g_sampler_cache->BindNearestSampler(10);
|
||||
|
||||
OpenGL_BindAttributelessVAO();
|
||||
ProgramShaderCache::BindVertexFormat(nullptr);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
FramebufferManager::SetFramebuffer(0);
|
||||
|
@ -496,8 +496,6 @@ void TextureCache::CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_copy,
|
|||
|
||||
FramebufferManager::SetFramebuffer(destination_texture->GetFramebuffer());
|
||||
|
||||
OpenGL_BindAttributelessVAO();
|
||||
|
||||
glActiveTexture(GL_TEXTURE9);
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, read_texture);
|
||||
if (scale_by_half)
|
||||
|
@ -539,6 +537,7 @@ void TextureCache::CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_copy,
|
|||
glUniform4f(shader.position_uniform, static_cast<float>(R.left), static_cast<float>(R.top),
|
||||
static_cast<float>(R.right), static_cast<float>(R.bottom));
|
||||
|
||||
ProgramShaderCache::BindVertexFormat(nullptr);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
FramebufferManager::SetFramebuffer(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue