diff options
| author | 2018-07-02 13:33:06 -0500 | |
|---|---|---|
| committer | 2018-07-02 13:33:06 -0500 | |
| commit | 18c8ae7750d0dac42c94ef41be041aeea6eb2e9e (patch) | |
| tree | e87502dbc7c76d7f97527b88ba5a5cc9f77f6103 /src | |
| parent | MaxwellToGL: Added conversion functions for depth test and cull mode. (diff) | |
| download | yuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.tar.gz yuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.tar.xz yuzu-18c8ae7750d0dac42c94ef41be041aeea6eb2e9e.zip | |
GPU: Set up the depth test state on every draw.
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 11 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index b80f4336d..0d0e0653d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -304,6 +304,9 @@ void RasterizerOpenGL::DrawArrays() { | |||
| 304 | MICROPROFILE_SCOPE(OpenGL_Drawing); | 304 | MICROPROFILE_SCOPE(OpenGL_Drawing); |
| 305 | const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs; | 305 | const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs; |
| 306 | 306 | ||
| 307 | // Sync the depth test state before configuring the framebuffer surfaces. | ||
| 308 | SyncDepthTestState(); | ||
| 309 | |||
| 307 | // TODO(bunnei): Implement these | 310 | // TODO(bunnei): Implement these |
| 308 | const bool has_stencil = false; | 311 | const bool has_stencil = false; |
| 309 | const bool using_color_fb = true; | 312 | const bool using_color_fb = true; |
| @@ -719,6 +722,14 @@ void RasterizerOpenGL::SyncDepthOffset() { | |||
| 719 | UNREACHABLE(); | 722 | UNREACHABLE(); |
| 720 | } | 723 | } |
| 721 | 724 | ||
| 725 | void RasterizerOpenGL::SyncDepthTestState() { | ||
| 726 | const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs; | ||
| 727 | |||
| 728 | state.depth.test_enabled = regs.depth_test_enable != 0; | ||
| 729 | state.depth.write_mask = regs.depth_write_enabled ? GL_TRUE : GL_FALSE; | ||
| 730 | state.depth.test_func = MaxwellToGL::ComparisonOp(regs.depth_test_func); | ||
| 731 | } | ||
| 732 | |||
| 722 | void RasterizerOpenGL::SyncBlendState() { | 733 | void RasterizerOpenGL::SyncBlendState() { |
| 723 | const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs; | 734 | const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs; |
| 724 | 735 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 621200f03..493aa39e5 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -126,6 +126,9 @@ private: | |||
| 126 | /// Syncs the depth offset to match the guest state | 126 | /// Syncs the depth offset to match the guest state |
| 127 | void SyncDepthOffset(); | 127 | void SyncDepthOffset(); |
| 128 | 128 | ||
| 129 | /// Syncs the depth test state to match the guest state | ||
| 130 | void SyncDepthTestState(); | ||
| 131 | |||
| 129 | /// Syncs the blend state to match the guest state | 132 | /// Syncs the blend state to match the guest state |
| 130 | void SyncBlendState(); | 133 | void SyncBlendState(); |
| 131 | 134 | ||