diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2019-12-11 01:20:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 01:20:52 +0100 |
commit | c8db7d1399bf83937debe347e6d214c501afdff6 (patch) | |
tree | 82e494fd45cf84d676b1e0b3c88e08bc0ce17300 /src/video_core/renderer_opengl | |
parent | Merge pull request #3208 from ReinUsesLisp/vk-shader-decompiler (diff) | |
parent | Maxwell3D: Implement Depth Mode. (diff) | |
download | yuzu-c8db7d1399bf83937debe347e6d214c501afdff6.tar yuzu-c8db7d1399bf83937debe347e6d214c501afdff6.tar.gz yuzu-c8db7d1399bf83937debe347e6d214c501afdff6.tar.bz2 yuzu-c8db7d1399bf83937debe347e6d214c501afdff6.tar.lz yuzu-c8db7d1399bf83937debe347e6d214c501afdff6.tar.xz yuzu-c8db7d1399bf83937debe347e6d214c501afdff6.tar.zst yuzu-c8db7d1399bf83937debe347e6d214c501afdff6.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 4 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 5 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 1 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 9eef7fcd2..88d78d2ad 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1028,6 +1028,10 @@ void RasterizerOpenGL::SyncViewport(OpenGLState& current_state) { flip_y = !flip_y; } state.clip_control.origin = flip_y ? GL_UPPER_LEFT : GL_LOWER_LEFT; + state.clip_control.depth_mode = + regs.depth_mode == Tegra::Engines::Maxwell3D::Regs::DepthMode::ZeroToOne + ? GL_ZERO_TO_ONE + : GL_NEGATIVE_ONE_TO_ONE; } void RasterizerOpenGL::SyncClipEnabled( diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 39b3986d3..ccc1e050a 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -411,8 +411,9 @@ void OpenGLState::ApplyAlphaTest() { } void OpenGLState::ApplyClipControl() { - if (UpdateValue(cur_state.clip_control.origin, clip_control.origin)) { - glClipControl(clip_control.origin, GL_NEGATIVE_ONE_TO_ONE); + if (UpdateTie(std::tie(cur_state.clip_control.origin, cur_state.clip_control.depth_mode), + std::tie(clip_control.origin, clip_control.depth_mode))) { + glClipControl(clip_control.origin, clip_control.depth_mode); } } diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index e53c2c5f2..0b5895084 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h @@ -150,6 +150,7 @@ public: struct { GLenum origin = GL_LOWER_LEFT; + GLenum depth_mode = GL_NEGATIVE_ONE_TO_ONE; } clip_control; OpenGLState(); |