diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-03-22 07:26:07 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-03-22 07:26:07 +0100 |
commit | bdcedc850602bd375caeb21c053426062b462c99 (patch) | |
tree | 6f9eac3aa2fc126c861decb3421203313b7333d7 | |
parent | Merge pull request #3531 from makigumo/yuzu_master (diff) | |
download | yuzu-bdcedc850602bd375caeb21c053426062b462c99.tar yuzu-bdcedc850602bd375caeb21c053426062b462c99.tar.gz yuzu-bdcedc850602bd375caeb21c053426062b462c99.tar.bz2 yuzu-bdcedc850602bd375caeb21c053426062b462c99.tar.lz yuzu-bdcedc850602bd375caeb21c053426062b462c99.tar.xz yuzu-bdcedc850602bd375caeb21c053426062b462c99.tar.zst yuzu-bdcedc850602bd375caeb21c053426062b462c99.zip |
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 063f41327..826eee7df 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -933,13 +933,15 @@ void RasterizerOpenGL::SyncViewport() { } flags[Dirty::Viewport0 + i] = false; - const Common::Rectangle<f32> rect{regs.viewport_transform[i].GetRect()}; + const auto& src = regs.viewport_transform[i]; + const Common::Rectangle<f32> rect{src.GetRect()}; glViewportIndexedf(static_cast<GLuint>(i), rect.left, rect.bottom, rect.GetWidth(), rect.GetHeight()); - const auto& src = regs.viewports[i]; - glDepthRangeIndexed(static_cast<GLuint>(i), static_cast<GLdouble>(src.depth_range_near), - static_cast<GLdouble>(src.depth_range_far)); + const GLdouble reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne; + const GLdouble near_depth = src.translate_z - src.scale_z * reduce_z; + const GLdouble far_depth = src.translate_z + src.scale_z; + glDepthRangeIndexed(static_cast<GLuint>(i), near_depth, far_depth); } } } |