summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri')
-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 d78fb4ed09..3b7e421b16 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);
}
}