diff options
author | Subv <subv2112@gmail.com> | 2015-12-02 19:23:51 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-06-28 06:14:13 +0200 |
commit | f9be06b15f08cb559580e1d19b43158640a37d67 (patch) | |
tree | 9b20e75d7ef02e0feac2be0cb96843ebbb6814f8 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Merge pull request #1930 from scurest/superfluous-moves (diff) | |
download | yuzu-f9be06b15f08cb559580e1d19b43158640a37d67.tar yuzu-f9be06b15f08cb559580e1d19b43158640a37d67.tar.gz yuzu-f9be06b15f08cb559580e1d19b43158640a37d67.tar.bz2 yuzu-f9be06b15f08cb559580e1d19b43158640a37d67.tar.lz yuzu-f9be06b15f08cb559580e1d19b43158640a37d67.tar.xz yuzu-f9be06b15f08cb559580e1d19b43158640a37d67.tar.zst yuzu-f9be06b15f08cb559580e1d19b43158640a37d67.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 328a4f66b..14ee97d57 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -353,6 +353,15 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) { SyncColorWriteMask(); break; + // Scissor test + case PICA_REG_INDEX(scissor_test.mode): + shader_dirty = true; + break; + case PICA_REG_INDEX(scissor_test.right): + case PICA_REG_INDEX(scissor_test.left_minus_1): + SyncScissorTest(); + break; + // Logic op case PICA_REG_INDEX(output_merger.logic_op): SyncLogicOp(); @@ -1002,6 +1011,7 @@ void RasterizerOpenGL::SetShader() { SyncDepthOffset(); SyncAlphaTest(); SyncCombinerColor(); + SyncScissorTest(); auto& tev_stages = Pica::g_state.regs.GetTevStages(); for (int index = 0; index < tev_stages.size(); ++index) SyncTevConstColor(index, tev_stages[index]); @@ -1166,6 +1176,22 @@ void RasterizerOpenGL::SyncDepthTest() { PicaToGL::CompareFunc(regs.output_merger.depth_test_func) : GL_ALWAYS; } +void RasterizerOpenGL::SyncScissorTest() { + const auto& regs = Pica::g_state.regs; + + if (uniform_block_data.data.scissor_right != regs.scissor_test.right || + uniform_block_data.data.scissor_bottom != regs.scissor_test.bottom || + uniform_block_data.data.scissor_left != regs.scissor_test.GetLeft() || + uniform_block_data.data.scissor_top != regs.scissor_test.GetTop()) { + + uniform_block_data.data.scissor_right = regs.scissor_test.right; + uniform_block_data.data.scissor_bottom = regs.scissor_test.bottom; + uniform_block_data.data.scissor_left = regs.scissor_test.GetLeft(); + uniform_block_data.data.scissor_top = regs.scissor_test.GetTop(); + uniform_block_data.dirty = true; + } +} + void RasterizerOpenGL::SyncCombinerColor() { auto combiner_color = PicaToGL::ColorRGBA8(Pica::g_state.regs.tev_combiner_buffer_color.raw); if (combiner_color != uniform_block_data.data.tev_combiner_buffer_color) { |