diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-29 23:23:40 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 21:56:42 +0100 |
commit | b910a83a47a2b566a760dbd20ff5902f303044d4 (patch) | |
tree | 8b8952cf2132b21bf6a5da304aaeeab9de4bfa8c /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | gl_state_tracker: Implement dirty flags for blending (diff) | |
download | yuzu-b910a83a47a2b566a760dbd20ff5902f303044d4.tar yuzu-b910a83a47a2b566a760dbd20ff5902f303044d4.tar.gz yuzu-b910a83a47a2b566a760dbd20ff5902f303044d4.tar.bz2 yuzu-b910a83a47a2b566a760dbd20ff5902f303044d4.tar.lz yuzu-b910a83a47a2b566a760dbd20ff5902f303044d4.tar.xz yuzu-b910a83a47a2b566a760dbd20ff5902f303044d4.tar.zst yuzu-b910a83a47a2b566a760dbd20ff5902f303044d4.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index cedfe5db1..6d87b4e29 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -995,12 +995,25 @@ void RasterizerOpenGL::SyncClipCoef() { } void RasterizerOpenGL::SyncCullMode() { - const auto& regs = system.GPU().Maxwell3D().regs; + auto& gpu = system.GPU().Maxwell3D(); + auto& flags = gpu.dirty.flags; + const auto& regs = gpu.regs; - oglEnable(GL_CULL_FACE, regs.cull_test_enabled); - glCullFace(MaxwellToGL::CullFace(regs.cull_face)); + if (flags[Dirty::CullTest]) { + flags[Dirty::CullTest] = false; - glFrontFace(MaxwellToGL::FrontFace(regs.front_face)); + if (regs.cull_test_enabled) { + glEnable(GL_CULL_FACE); + glCullFace(MaxwellToGL::CullFace(regs.cull_face)); + } else { + glDisable(GL_CULL_FACE); + } + } + + if (flags[Dirty::FrontFace]) { + flags[Dirty::FrontFace] = false; + glFrontFace(MaxwellToGL::FrontFace(regs.front_face)); + } } void RasterizerOpenGL::SyncPrimitiveRestart() { |