diff options
author | bunnei <bunneidev@gmail.com> | 2018-10-10 18:04:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-10 18:04:10 +0200 |
commit | 03ec936ca007364e2c287f78dbbe8c5551dc2234 (patch) | |
tree | b638d61299f8bdfe54c08bff94f1d07b4d22b2a3 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Merge pull request #1425 from ReinUsesLisp/geometry-shaders (diff) | |
parent | Implement Scissor Test (diff) | |
download | yuzu-03ec936ca007364e2c287f78dbbe8c5551dc2234.tar yuzu-03ec936ca007364e2c287f78dbbe8c5551dc2234.tar.gz yuzu-03ec936ca007364e2c287f78dbbe8c5551dc2234.tar.bz2 yuzu-03ec936ca007364e2c287f78dbbe8c5551dc2234.tar.lz yuzu-03ec936ca007364e2c287f78dbbe8c5551dc2234.tar.xz yuzu-03ec936ca007364e2c287f78dbbe8c5551dc2234.tar.zst yuzu-03ec936ca007364e2c287f78dbbe8c5551dc2234.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index b7215448c..84582c777 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -552,6 +552,7 @@ void RasterizerOpenGL::DrawArrays() { SyncLogicOpState(); SyncCullMode(); SyncAlphaTest(); + SyncScissorTest(); SyncTransformFeedback(); SyncPointState(); @@ -984,6 +985,22 @@ void RasterizerOpenGL::SyncAlphaTest() { } } +void RasterizerOpenGL::SyncScissorTest() { + const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; + + state.scissor.enabled = (regs.scissor_test.enable != 0); + // TODO(Blinkhawk): Figure if the hardware supports scissor testing per viewport and how it's + // implemented. + if (regs.scissor_test.enable != 0) { + const u32 width = regs.scissor_test.max_x - regs.scissor_test.min_x; + const u32 height = regs.scissor_test.max_y - regs.scissor_test.min_y; + state.scissor.x = regs.scissor_test.min_x; + state.scissor.y = regs.scissor_test.min_y; + state.scissor.width = width; + state.scissor.height = height; + } +} + void RasterizerOpenGL::SyncTransformFeedback() { const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; |