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:
Stenzek
2018-01-21 00:59:10 +10:00
parent fca9c28f38
commit 3fd4142f36
9 changed files with 59 additions and 29 deletions

View File

@ -111,8 +111,6 @@ static void EncodeToRamUsingShader(GLuint srcTexture, u8* destAddr, u32 dst_line
FramebufferManager::SetFramebuffer(
static_cast<OGLTexture*>(s_encoding_render_texture.get())->GetFramebuffer());
OpenGL_BindAttributelessVAO();
// set source texture
glActiveTexture(GL_TEXTURE9);
glBindTexture(GL_TEXTURE_2D_ARRAY, srcTexture);
@ -128,6 +126,7 @@ static void EncodeToRamUsingShader(GLuint srcTexture, u8* destAddr, u32 dst_line
glViewport(0, 0, (GLsizei)(dst_line_size / 4), (GLsizei)dstHeight);
ProgramShaderCache::BindVertexFormat(nullptr);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
MathUtil::Rectangle<int> copy_rect(0, 0, dst_line_size / 4, dstHeight);