diff options
| author | 2018-10-08 21:21:22 -0400 | |
|---|---|---|
| committer | 2018-10-08 21:36:23 -0400 | |
| commit | be97fc884df62d18aa488be7f019e6db6696636b (patch) | |
| tree | ddfc22404ac38eeb27447c9552a356fd09916351 /src | |
| parent | Assert Scissor tests (diff) | |
| download | yuzu-be97fc884df62d18aa488be7f019e6db6696636b.tar.gz yuzu-be97fc884df62d18aa488be7f019e6db6696636b.tar.xz yuzu-be97fc884df62d18aa488be7f019e6db6696636b.zip | |
Implement Scissor Test
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 41e59a457..daae67121 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -976,11 +976,16 @@ void RasterizerOpenGL::SyncAlphaTest() { | |||
| 976 | void RasterizerOpenGL::SyncScissorTest() { | 976 | void RasterizerOpenGL::SyncScissorTest() { |
| 977 | const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; | 977 | const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs; |
| 978 | 978 | ||
| 979 | // TODO(Rodrigo): Alpha testing is a legacy OpenGL feature, but it can be | 979 | state.scissor.enabled = (regs.scissor_test.enable != 0); |
| 980 | // implemented with a test+discard in fragment shaders. | 980 | // TODO(Blinkhawk): Figure if the hardware supports scissor testing per viewport and how it's |
| 981 | // implemented. | ||
| 981 | if (regs.scissor_test.enable != 0) { | 982 | if (regs.scissor_test.enable != 0) { |
| 982 | LOG_CRITICAL(Render_OpenGL, "Scissor testing is not implemented"); | 983 | const u32 width = regs.scissor_test.max_x - regs.scissor_test.min_x; |
| 983 | UNREACHABLE(); | 984 | const u32 height = regs.scissor_test.max_y - regs.scissor_test.min_y; |
| 985 | state.scissor.x = regs.scissor_test.min_x; | ||
| 986 | state.scissor.y = regs.scissor_test.min_y; | ||
| 987 | state.scissor.width = width; | ||
| 988 | state.scissor.height = height; | ||
| 984 | } | 989 | } |
| 985 | } | 990 | } |
| 986 | 991 | ||