summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-04 18:13:38 +0200
committerGitHub <noreply@github.com>2018-07-04 18:13:38 +0200
commit2355460d7c68b3c16d54df39cfd6f79399c942f5 (patch)
tree1c5e8b100f41d3362de6e8b8f0d5db2f4aa7fd8d /src/video_core/renderer_opengl/gl_rasterizer.cpp
parentMerge pull request #618 from Subv/clear_used_buffers (diff)
parentGPU: Flip the triangle front face winding if the GPU is configured to not flip the triangles. (diff)
downloadyuzu-2355460d7c68b3c16d54df39cfd6f79399c942f5.tar
yuzu-2355460d7c68b3c16d54df39cfd6f79399c942f5.tar.gz
yuzu-2355460d7c68b3c16d54df39cfd6f79399c942f5.tar.bz2
yuzu-2355460d7c68b3c16d54df39cfd6f79399c942f5.tar.lz
yuzu-2355460d7c68b3c16d54df39cfd6f79399c942f5.tar.xz
yuzu-2355460d7c68b3c16d54df39cfd6f79399c942f5.tar.zst
yuzu-2355460d7c68b3c16d54df39cfd6f79399c942f5.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index e516eb1ad..3c3657d9d 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -771,6 +771,16 @@ void RasterizerOpenGL::SyncCullMode() {
if (state.cull.enabled) {
state.cull.front_face = MaxwellToGL::FrontFace(regs.cull.front_face);
state.cull.mode = MaxwellToGL::CullFace(regs.cull.cull_face);
+
+ // If the GPU is configured to flip the rasterized triangles, then we need to flip the
+ // notion of front and back. Note: We flip the triangles when the value of the register is 0
+ // because OpenGL already does it for us.
+ if (regs.screen_y_control.triangle_rast_flip == 0) {
+ if (state.cull.front_face == GL_CCW)
+ state.cull.front_face = GL_CW;
+ else if (state.cull.front_face == GL_CW)
+ state.cull.front_face = GL_CCW;
+ }
}
}