diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-30 03:25:53 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 21:56:42 +0100 |
commit | 46a1888e02f04c1478fbf61ae003f14d09c70a42 (patch) | |
tree | fbe7f434d35462665a4b06cd8a20d607dcd56b7c /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | gl_state_tracker: Implement dirty flags for stencil testing (diff) | |
download | yuzu-46a1888e02f04c1478fbf61ae003f14d09c70a42.tar yuzu-46a1888e02f04c1478fbf61ae003f14d09c70a42.tar.gz yuzu-46a1888e02f04c1478fbf61ae003f14d09c70a42.tar.bz2 yuzu-46a1888e02f04c1478fbf61ae003f14d09c70a42.tar.lz yuzu-46a1888e02f04c1478fbf61ae003f14d09c70a42.tar.xz yuzu-46a1888e02f04c1478fbf61ae003f14d09c70a42.tar.zst yuzu-46a1888e02f04c1478fbf61ae003f14d09c70a42.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index bc4542b69..ebb072d91 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1017,10 +1017,19 @@ void RasterizerOpenGL::SyncCullMode() { } void RasterizerOpenGL::SyncPrimitiveRestart() { - const auto& regs = system.GPU().Maxwell3D().regs; + auto& gpu = system.GPU().Maxwell3D(); + auto& flags = gpu.dirty.flags; + if (!flags[Dirty::PrimitiveRestart]) { + return; + } + flags[Dirty::PrimitiveRestart] = false; - oglEnable(GL_PRIMITIVE_RESTART, regs.primitive_restart.enabled); - glPrimitiveRestartIndex(regs.primitive_restart.index); + if (gpu.regs.primitive_restart.enabled) { + glEnable(GL_PRIMITIVE_RESTART); + glPrimitiveRestartIndex(gpu.regs.primitive_restart.index); + } else { + glDisable(GL_PRIMITIVE_RESTART); + } } void RasterizerOpenGL::SyncDepthTestState() { |