From f21c2d7ddbe265b2df062fb91b99eea460e2d4cc Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Tue, 12 Feb 2019 00:44:52 +0100 Subject: [PATCH] psh: Use output clamping from NV_register_combiners GL extension --- hw/xbox/nv2a/nv2a_psh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xbox/nv2a/nv2a_psh.c b/hw/xbox/nv2a/nv2a_psh.c index 2e84097030..fbf0636ca4 100644 --- a/hw/xbox/nv2a/nv2a_psh.c +++ b/hw/xbox/nv2a/nv2a_psh.c @@ -422,7 +422,7 @@ static void add_stage_code(struct PixelShader *ps, QString *sum_dest = get_var(ps, output.muxsum, true); if (qstring_get_length(ab_dest)) { - qstring_append_fmt(ps->code, "%s.%s = %s(%s);\n", + qstring_append_fmt(ps->code, "%s.%s = clamp(%s(%s), -1.0, 1.0);\n", qstring_get_str(ab_dest), write_mask, caster, qstring_get_str(ab_mapping)); } else { qobject_unref(ab_dest); @@ -431,7 +431,7 @@ static void add_stage_code(struct PixelShader *ps, } if (qstring_get_length(cd_dest)) { - qstring_append_fmt(ps->code, "%s.%s = %s(%s);\n", + qstring_append_fmt(ps->code, "%s.%s = clamp(%s(%s), -1.0, 1.0);\n", qstring_get_str(cd_dest), write_mask, caster, qstring_get_str(cd_mapping)); } else { qobject_unref(cd_dest); @@ -458,7 +458,7 @@ static void add_stage_code(struct PixelShader *ps, QString *sum_mapping = get_output(sum, output.mapping); if (qstring_get_length(sum_dest)) { - qstring_append_fmt(ps->code, "%s.%s = %s(%s);\n", + qstring_append_fmt(ps->code, "%s.%s = clamp(%s(%s), -1.0, 1.0);\n", qstring_get_str(sum_dest), write_mask, caster, qstring_get_str(sum_mapping)); }