diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-26 05:57:38 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-26 21:33:50 +0200 |
commit | 606a62d4c740eec470b19e57322645de20866abf (patch) | |
tree | b3601eb861cda03dc6f12b752369f978de28a7b5 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | fixed_pipeline_state: Remove unnecessary check for front faces flip (diff) | |
download | yuzu-606a62d4c740eec470b19e57322645de20866abf.tar yuzu-606a62d4c740eec470b19e57322645de20866abf.tar.gz yuzu-606a62d4c740eec470b19e57322645de20866abf.tar.bz2 yuzu-606a62d4c740eec470b19e57322645de20866abf.tar.lz yuzu-606a62d4c740eec470b19e57322645de20866abf.tar.xz yuzu-606a62d4c740eec470b19e57322645de20866abf.tar.zst yuzu-606a62d4c740eec470b19e57322645de20866abf.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 8116a5daa..efbbf11f9 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1031,6 +1031,26 @@ void RasterizerOpenGL::SyncViewport() { const auto& regs = gpu.regs; const bool dirty_viewport = flags[Dirty::Viewports]; + const bool dirty_clip_control = flags[Dirty::ClipControl]; + + if (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) { + switch (mode) { + case GL_CW: + mode = GL_CCW; + break; + case GL_CCW: + mode = GL_CW; + break; + } + } + glFrontFace(mode); + } + if (dirty_viewport || flags[Dirty::ClipControl]) { flags[Dirty::ClipControl] = false; @@ -1128,11 +1148,6 @@ void RasterizerOpenGL::SyncCullMode() { glDisable(GL_CULL_FACE); } } - - if (flags[Dirty::FrontFace]) { - flags[Dirty::FrontFace] = false; - glFrontFace(MaxwellToGL::FrontFace(regs.front_face)); - } } void RasterizerOpenGL::SyncPrimitiveRestart() { |