summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-03-24 10:26:05 -0700
committerEric Anholt <[email protected]>2010-03-24 10:27:30 -0700
commit3695cdd6061abe5af430bddaac2237bff3d87ad0 (patch)
treeb5c97907bf17399ca025961e6f87d2178884c9c0 /src/mesa/drivers
parent01f7acb700789abacca21e89400f57375eb82499 (diff)
i965: Handle the negate and abs swizzles on brw_wm_glsl.c immediate args.
Fixes piglit glsl-orangebook-ch06-bump, regressed with 4fc57322258a750c0a9cabc77372b5ccde1fa877
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_glsl.c14
1 files changed, 12 insertions, 2 deletions
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);
}
}