From 316513964a0ded18ee74e6c9c110c434d02c4a36 Mon Sep 17 00:00:00 2001 From: Voxel9 <16278868+Voxel9@users.noreply.github.com> Date: Sat, 27 Jun 2020 21:21:50 +0100 Subject: [PATCH] nv2a: Fix FFP texgen assertions Should compare against channel index instead of texture stage index --- hw/xbox/nv2a/nv2a_shaders.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xbox/nv2a/nv2a_shaders.c b/hw/xbox/nv2a/nv2a_shaders.c index 8f30b04404..665f2b5e37 100644 --- a/hw/xbox/nv2a/nv2a_shaders.c +++ b/hw/xbox/nv2a/nv2a_shaders.c @@ -431,7 +431,7 @@ GLSL_DEFINE(sceneAmbientColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_FR_AMB) ".xyz") assert(false); /* Untested */ break; case TEXGEN_SPHERE_MAP: - assert(i < 2); /* Channels S,T only! */ + assert(j < 2); /* Channels S,T only! */ qstring_append(body, "{\n"); /* FIXME: u, r and m only have to be calculated once */ qstring_append(body, " vec3 u = normalize(tPosition.xyz);\n"); @@ -451,7 +451,7 @@ GLSL_DEFINE(sceneAmbientColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_FR_AMB) ".xyz") qstring_append(body, "}\n"); break; case TEXGEN_REFLECTION_MAP: - assert(i < 3); /* Channels S,T,R only! */ + assert(j < 3); /* Channels S,T,R only! */ qstring_append(body, "{\n"); /* FIXME: u and r only have to be calculated once, can share the one from SPHERE_MAP */ qstring_append(body, " vec3 u = normalize(tPosition.xyz);\n"); @@ -461,7 +461,7 @@ GLSL_DEFINE(sceneAmbientColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_FR_AMB) ".xyz") qstring_append(body, "}\n"); break; case TEXGEN_NORMAL_MAP: - assert(i < 3); /* Channels S,T,R only! */ + assert(j < 3); /* Channels S,T,R only! */ qstring_append_fmt(body, "oT%d.%c = tNormal.%c;\n", i, c, c); break;