diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-26 01:52:39 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-28 20:52:46 +0100 |
commit | e1a16a52fa14835efe6ba9b7418be419cdc4e5d5 (patch) | |
tree | eaef33afaba0f9e7c084cf879e65ce68026fb67d /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | gl_state: Remove primitive restart tracking (diff) | |
download | yuzu-e1a16a52fa14835efe6ba9b7418be419cdc4e5d5.tar yuzu-e1a16a52fa14835efe6ba9b7418be419cdc4e5d5.tar.gz yuzu-e1a16a52fa14835efe6ba9b7418be419cdc4e5d5.tar.bz2 yuzu-e1a16a52fa14835efe6ba9b7418be419cdc4e5d5.tar.lz yuzu-e1a16a52fa14835efe6ba9b7418be419cdc4e5d5.tar.xz yuzu-e1a16a52fa14835efe6ba9b7418be419cdc4e5d5.tar.zst yuzu-e1a16a52fa14835efe6ba9b7418be419cdc4e5d5.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 975cd2f12..6bb6f9f47 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -446,12 +446,8 @@ void RasterizerOpenGL::Clear() { ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear Z but buffer is not enabled!"); use_depth = true; - // Always enable the depth write when clearing the depth buffer. The depth write mask is - // ignored when clearing the buffer in the Switch, but OpenGL obeys it so we set it to - // true. - clear_state.depth.test_enabled = true; - clear_state.depth.test_func = GL_ALWAYS; - clear_state.depth.write_mask = GL_TRUE; + // TODO: Signal state tracker about these changes + glDepthMask(GL_TRUE); } if (regs.clear_buffers.S) { ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear stencil but buffer is not enabled!"); @@ -1036,14 +1032,12 @@ void RasterizerOpenGL::SyncPrimitiveRestart() { void RasterizerOpenGL::SyncDepthTestState() { const auto& regs = system.GPU().Maxwell3D().regs; - state.depth.test_enabled = regs.depth_test_enable != 0; - state.depth.write_mask = regs.depth_write_enabled ? GL_TRUE : GL_FALSE; + glDepthMask(regs.depth_write_enabled ? GL_TRUE : GL_FALSE); - if (!state.depth.test_enabled) { - return; + oglEnable(GL_DEPTH_TEST, regs.depth_test_enable); + if (regs.depth_test_enable) { + glDepthFunc(MaxwellToGL::ComparisonOp(regs.depth_test_func)); } - - state.depth.test_func = MaxwellToGL::ComparisonOp(regs.depth_test_func); } void RasterizerOpenGL::SyncStencilTestState() { |