From a9303acfdfc56b69f8d0280809522d0f6d218710 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 26 Dec 2021 12:10:47 +0300 Subject: [PATCH] rsx: Fix zclip w scaling --- rpcs3/Emu/RSX/Program/GLSLCommon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Program/GLSLCommon.cpp b/rpcs3/Emu/RSX/Program/GLSLCommon.cpp index 308ab3f66a..1c44360be4 100644 --- a/rpcs3/Emu/RSX/Program/GLSLCommon.cpp +++ b/rpcs3/Emu/RSX/Program/GLSLCommon.cpp @@ -614,7 +614,7 @@ namespace glsl " const float real_f = max(far_plane, near_plane);\n" " const double depth_range = double(real_f - real_n);\n" " const double inv_range = (depth_range > 0.000001) ? (1.0 / (depth_range * pos.w)) : 0.0;\n" - " const double d = (double(pos.z) - real_n) * inv_range;\n" + " const double d = (double(pos.z) - double(real_n * pos.w)) * inv_range;\n" " return vec4(pos.xy, float(d * pos.w), pos.w);\n" " }\n" " else\n"