Skip to content

Commit

Permalink
OGL: Disable scissor test when calling glBlitFramebuffer()
Browse files Browse the repository at this point in the history
glBlitFramebuffer() does not bypass the scissor test, which meant that
part of texture copies (e.g. XFB) could have been clipped when running
under OpenGL ES, as glCopyImageSubData() is not supported.
  • Loading branch information
stenzek committed Oct 9, 2018
1 parent 4809726 commit 2e90545
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/Core/VideoBackends/OGL/OGLTexture.cpp
Expand Up @@ -234,6 +234,9 @@ void OGLTexture::BlitFramebuffer(OGLTexture* srcentry, const MathUtil::Rectangle
dst_layer); dst_layer);
} }


// glBlitFramebuffer is still affected by the scissor test, which is enabled by default.
glDisable(GL_SCISSOR_TEST);

glBlitFramebuffer(src_rect.left, src_rect.top, src_rect.right, src_rect.bottom, dst_rect.left, glBlitFramebuffer(src_rect.left, src_rect.top, src_rect.right, src_rect.bottom, dst_rect.left,
dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, GL_NEAREST); dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, GL_NEAREST);


Expand All @@ -252,6 +255,9 @@ void OGLTexture::BlitFramebuffer(OGLTexture* srcentry, const MathUtil::Rectangle
0); 0);
} }


// The default state for the scissor test is enabled. We don't need to do a full state
// restore, as the framebuffer and scissor test are the only things we changed.
glEnable(GL_SCISSOR_TEST);
FramebufferManager::SetFramebuffer(0); FramebufferManager::SetFramebuffer(0);
} }


Expand Down

0 comments on commit 2e90545

Please sign in to comment.