diff options
author | Eric Anholt <[email protected]> | 2010-03-24 10:26:05 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-03-24 10:27:30 -0700 |
commit | 3695cdd6061abe5af430bddaac2237bff3d87ad0 (patch) | |
tree | b5c97907bf17399ca025961e6f87d2178884c9c0 | |
parent | 01f7acb700789abacca21e89400f57375eb82499 (diff) |
i965: Handle the negate and abs swizzles on brw_wm_glsl.c immediate args.
Fixes piglit glsl-orangebook-ch06-bump, regressed with
4fc57322258a750c0a9cabc77372b5ccde1fa877
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_glsl.c | 14 |
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); } } |