diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-29 02:31:00 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 21:56:42 +0100 |
commit | ba6f390448987c01ae0e4b7ffe98b77bbd47c6d9 (patch) | |
tree | 7361f386e668982a6d279d032d2b475291e4e398 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | gl_state_tracker: Implement dirty flags for viewports (diff) | |
download | yuzu-ba6f390448987c01ae0e4b7ffe98b77bbd47c6d9.tar yuzu-ba6f390448987c01ae0e4b7ffe98b77bbd47c6d9.tar.gz yuzu-ba6f390448987c01ae0e4b7ffe98b77bbd47c6d9.tar.bz2 yuzu-ba6f390448987c01ae0e4b7ffe98b77bbd47c6d9.tar.lz yuzu-ba6f390448987c01ae0e4b7ffe98b77bbd47c6d9.tar.xz yuzu-ba6f390448987c01ae0e4b7ffe98b77bbd47c6d9.tar.zst yuzu-ba6f390448987c01ae0e4b7ffe98b77bbd47c6d9.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 2427b8c07..2ec4c9f55 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1102,12 +1102,28 @@ void RasterizerOpenGL::SyncLogicOpState() { } void RasterizerOpenGL::SyncScissorTest() { - const auto& regs = system.GPU().Maxwell3D().regs; + auto& gpu = system.GPU().Maxwell3D(); + auto& flags = gpu.dirty.flags; + if (!flags[Dirty::Scissors]) { + return; + } + flags[Dirty::Scissors] = false; + + const auto& regs = gpu.regs; for (std::size_t index = 0; index < Maxwell::NumViewports; ++index) { + if (!flags[Dirty::Scissor0 + index]) { + continue; + } + flags[Dirty::Scissor0 + index] = false; + const auto& src = regs.scissor_test[index]; - oglEnablei(GL_SCISSOR_TEST, src.enable, static_cast<GLuint>(index)); - glScissorIndexed(static_cast<GLuint>(index), src.min_x, src.min_y, src.max_x - src.min_x, - src.max_y - src.min_y); + if (src.enable) { + glEnablei(GL_SCISSOR_TEST, static_cast<GLuint>(index)); + glScissorIndexed(static_cast<GLuint>(index), src.min_x, src.min_y, + src.max_x - src.min_x, src.max_y - src.min_y); + } else { + glDisablei(GL_SCISSOR_TEST, static_cast<GLuint>(index)); + } } } |