summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-08 12:27:15 -0400
committerGravatar bunnei2018-07-08 16:16:24 -0400
commit854f474f52ea49e26d61680e775b1c91e644b2fc (patch)
tree5bc885ae05a37e24e9b2dc0eb9fa1d54a93744d6 /src
parentMerge pull request #625 from Subv/imnmx (diff)
downloadyuzu-854f474f52ea49e26d61680e775b1c91e644b2fc.tar.gz
yuzu-854f474f52ea49e26d61680e775b1c91e644b2fc.tar.xz
yuzu-854f474f52ea49e26d61680e775b1c91e644b2fc.zip
gl_rasterizer: Flip triangles when regs.viewport_transform[0].scale_y is negative.
- Fixes a regression with Binding of Isaac.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index bacb389e1..ea138d402 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -775,10 +775,13 @@ void RasterizerOpenGL::SyncCullMode() {
775 state.cull.front_face = MaxwellToGL::FrontFace(regs.cull.front_face); 775 state.cull.front_face = MaxwellToGL::FrontFace(regs.cull.front_face);
776 state.cull.mode = MaxwellToGL::CullFace(regs.cull.cull_face); 776 state.cull.mode = MaxwellToGL::CullFace(regs.cull.cull_face);
777 777
778 const bool flip_triangles{regs.screen_y_control.triangle_rast_flip == 0 ||
779 regs.viewport_transform[0].scale_y < 0.0f};
780
778 // If the GPU is configured to flip the rasterized triangles, then we need to flip the 781 // If the GPU is configured to flip the rasterized triangles, then we need to flip the
779 // notion of front and back. Note: We flip the triangles when the value of the register is 0 782 // notion of front and back. Note: We flip the triangles when the value of the register is 0
780 // because OpenGL already does it for us. 783 // because OpenGL already does it for us.
781 if (regs.screen_y_control.triangle_rast_flip == 0) { 784 if (flip_triangles) {
782 if (state.cull.front_face == GL_CCW) 785 if (state.cull.front_face == GL_CCW)
783 state.cull.front_face = GL_CW; 786 state.cull.front_face = GL_CW;
784 else if (state.cull.front_face == GL_CW) 787 else if (state.cull.front_face == GL_CW)