From 50a5368f473ea95482f94fd4c7edd1b2b9709179 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Fri, 19 Nov 2021 13:48:04 -0700 Subject: [PATCH] Revert "nv2a/vsh: Use double precision in clip range remap" This reverts commit 1a15d83c44ce0ee8a9df762e9a54c66eb4149b65. --- hw/xbox/nv2a/vsh.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/xbox/nv2a/vsh.c b/hw/xbox/nv2a/vsh.c index e94446640d..4b1e7908de 100644 --- a/hw/xbox/nv2a/vsh.c +++ b/hw/xbox/nv2a/vsh.c @@ -776,15 +776,9 @@ void vsh_translate(uint16_t version, * Note this makes the values in the depth buffer wrong. This should be * handled with gl_ClipDistance instead, but that has performance issues * on OS X. - * - * This conversion is performed at double precision to handle max depth - * clipping in the Xbox z24s8 floating point mode. */ " if (clipRange.y != clipRange.x) {\n" - " double work = double(oPos.z - clipRange.x);\n" - " double half_full_distance = 0.5 * double(clipRange.y - clipRange.x);\n" - " oPos.z = float(work / half_full_distance);\n" - " oPos.z = oPos.z - 1;\n" + " oPos.z = (oPos.z - clipRange.x)/(0.5*(clipRange.y - clipRange.x)) - 1;\n" " }\n" /* Correct for the perspective divide */ @@ -800,3 +794,4 @@ void vsh_translate(uint16_t version, ); } +