From 7fc1fdb8fe7b2887fbc5d36e9673c9da776ae25e Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Mon, 27 Jul 2015 00:06:39 +0200 Subject: [PATCH] Clamp D0,D1,B0,B1 --- hw/xbox/nv2a_vsh.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xbox/nv2a_vsh.c b/hw/xbox/nv2a_vsh.c index 0fdd3e096c..231af2d473 100644 --- a/hw/xbox/nv2a_vsh.c +++ b/hw/xbox/nv2a_vsh.c @@ -787,10 +787,10 @@ QString* vsh_translate(uint16_t version, " %cPos_w = 1.0 / oPos.w;\n" "}\n" , output_prefix, output_prefix); - qstring_append_fmt(body, "%cD0 = oD0 * %cPos_w;\n", output_prefix, output_prefix); - qstring_append_fmt(body, "%cD1 = oD1 * %cPos_w;\n", output_prefix, output_prefix); - qstring_append_fmt(body, "%cB0 = oB0 * %cPos_w;\n", output_prefix, output_prefix); - qstring_append_fmt(body, "%cB1 = oB1 * %cPos_w;\n", output_prefix, output_prefix); + qstring_append_fmt(body, "%cD0 = clamp(oD0, 0.0, 1.0) * %cPos_w;\n", output_prefix, output_prefix); + qstring_append_fmt(body, "%cD1 = clamp(oD1, 0.0, 1.0) * %cPos_w;\n", output_prefix, output_prefix); + qstring_append_fmt(body, "%cB0 = clamp(oB0, 0.0, 1.0) * %cPos_w;\n", output_prefix, output_prefix); + qstring_append_fmt(body, "%cB1 = clamp(oB1, 0.0, 1.0) * %cPos_w;\n", output_prefix, output_prefix); qstring_append_fmt(body, "%cFog = oFog * %cPos_w;\n", output_prefix, output_prefix); qstring_append_fmt(body, "%cT0 = oT0 * %cPos_w;\n", output_prefix, output_prefix); qstring_append_fmt(body, "%cT1 = oT1 * %cPos_w;\n", output_prefix, output_prefix);