From: Eric Anholt Date: Wed, 24 Mar 2010 17:26:05 +0000 (-0700) Subject: i965: Handle the negate and abs swizzles on brw_wm_glsl.c immediate args. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3695cdd6061abe5af430bddaac2237bff3d87ad0;p=mesa.git i965: Handle the negate and abs swizzles on brw_wm_glsl.c immediate args. Fixes piglit glsl-orangebook-ch06-bump, regressed with 4fc57322258a750c0a9cabc77372b5ccde1fa877 --- diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index d78fb4ed09f..3b7e421b16a 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -583,11 +583,21 @@ static struct brw_reg get_src_reg(struct brw_wm_compile *c, if (component == SWIZZLE_ZERO) { return brw_imm_f(0.0F); } else if (component == SWIZZLE_ONE) { - return brw_imm_f(1.0F); + if (src->Negate) + return brw_imm_f(-1.0F); + else + return brw_imm_f(1.0F); } if (src->File == PROGRAM_CONSTANT) { - return brw_imm_f(params->ParameterValues[src->Index][component]); + float f = params->ParameterValues[src->Index][component]; + + if (src->Abs) + f = fabs(f); + if (src->Negate) + f = -f; + + return brw_imm_f(f); } }