From 43855d30505c466912fdf537b83fab406a5bbc2b Mon Sep 17 00:00:00 2001 From: Erik Abair Date: Tue, 20 May 2025 13:02:00 -0700 Subject: [PATCH] nv2a: Prevent NaN in specular power factor calculation --- hw/xbox/nv2a/pgraph/glsl/vsh-ff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xbox/nv2a/pgraph/glsl/vsh-ff.c b/hw/xbox/nv2a/pgraph/glsl/vsh-ff.c index 6bc637d582..ae838bf352 100644 --- a/hw/xbox/nv2a/pgraph/glsl/vsh-ff.c +++ b/hw/xbox/nv2a/pgraph/glsl/vsh-ff.c @@ -360,7 +360,7 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz mstring_append_fmt(body, " float pf;\n" - " if (nDotVP == 0.0) {\n" + " if (nDotVP == 0.0 || nDotHV == 0.0) {\n" " pf = 0.0;\n" " } else {\n" " pf = pow(nDotHV, specularPower);\n"