summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-04-04 16:30:48 +0200
committerLiam <byteslice@airmail.cc>2022-04-04 16:32:14 +0200
commita57531854e8eeeab65287083e4cdfe37c4e77bf9 (patch)
tree0f03c6f90394ed5c0be05cc18531d43b7e9bbb8e /src/video_core
parentOpenGL: flip front faces if Z scale is inverted (diff)
downloadyuzu-a57531854e8eeeab65287083e4cdfe37c4e77bf9.tar
yuzu-a57531854e8eeeab65287083e4cdfe37c4e77bf9.tar.gz
yuzu-a57531854e8eeeab65287083e4cdfe37c4e77bf9.tar.bz2
yuzu-a57531854e8eeeab65287083e4cdfe37c4e77bf9.tar.lz
yuzu-a57531854e8eeeab65287083e4cdfe37c4e77bf9.tar.xz
yuzu-a57531854e8eeeab65287083e4cdfe37c4e77bf9.tar.zst
yuzu-a57531854e8eeeab65287083e4cdfe37c4e77bf9.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 216139173..5fa2febb4 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -557,13 +557,19 @@ void RasterizerOpenGL::SyncViewport() {
const bool dirty_viewport = flags[Dirty::Viewports] || rescale_viewports;
const bool dirty_clip_control = flags[Dirty::ClipControl];
- if (dirty_clip_control || flags[Dirty::FrontFace]) {
+ if (dirty_viewport || dirty_clip_control || flags[Dirty::FrontFace]) {
flags[Dirty::FrontFace] = false;
GLenum mode = MaxwellToGL::FrontFace(regs.front_face);
- if ((regs.screen_y_control.triangle_rast_flip != 0 &&
- regs.viewport_transform[0].scale_y < 0.0f) ||
- regs.viewport_transform[0].scale_z < 0.0f) {
+ bool flip_faces = false;
+ if (regs.screen_y_control.triangle_rast_flip != 0 &&
+ regs.viewport_transform[0].scale_y < 0.0f) {
+ flip_faces = !flip_faces;
+ }
+ if (regs.viewport_transform[0].scale_z < 0.0f) {
+ flip_faces = !flip_faces;
+ }
+ if (flip_faces) {
switch (mode) {
case GL_CW:
mode = GL_CCW;