From 76e2b779e3b27bf02b847f79e17d0f9a9329373f Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Tue, 30 Jul 2024 17:01:41 -0700 Subject: [PATCH] nv2a/psh: Handle rect tex on project3d --- hw/xbox/nv2a/pgraph/glsl/psh.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/xbox/nv2a/pgraph/glsl/psh.c b/hw/xbox/nv2a/pgraph/glsl/psh.c index fae76043fd..295cc9a1f7 100644 --- a/hw/xbox/nv2a/pgraph/glsl/psh.c +++ b/hw/xbox/nv2a/pgraph/glsl/psh.c @@ -931,8 +931,8 @@ static MString* psh_convert(struct PixelShader *ps) psh_append_shadowmap(ps, i, true, vars); } else { apply_border_adjustment(ps, vars, i, "pT%d"); - mstring_append_fmt(vars, "vec4 t%d = textureProj(texSamp%d, pT%d.xyzw);\n", - i, i, i); + mstring_append_fmt(vars, "vec4 t%d = textureProj(texSamp%d, %s(pT%d.xyzw));\n", + i, i, tex_remap, i); } break; case PS_TEXTUREMODES_CUBEMAP: @@ -1129,6 +1129,11 @@ static MString* psh_convert(struct PixelShader *ps) " return vec3(norm%d(coord.xy), coord.z);\n" "}\n", i, i); + mstring_append_fmt(preflight, + "vec4 norm%d(vec4 coord) {\n" + " return vec4(norm%d(coord.xy), 0, coord.w);\n" + "}\n", + i, i); } } }