From a9c62a2340794977a87cba4a352c02fc16f81505 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 31 Mar 2009 14:25:32 -0600 Subject: [PATCH] i965: do negation and Abs in get_src_reg_imm() Fixes regression seen with progs/glsl/bump.c --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 4e99611be81..67ba59c3252 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -276,7 +276,12 @@ static struct brw_reg get_src_reg_imm(struct brw_wm_compile *c, const int component = GET_SWZ(src->Swizzle, index); const GLfloat *param = c->fp->program.Base.Parameters->ParameterValues[src->Index]; - return brw_imm_f(param[component]); + GLfloat value = param[component]; + if (src->NegateBase) + value = -value; + if (src->Abs) + value = FABSF(value); + return brw_imm_f(value); } else { return get_src_reg(c, src, index); -- 2.30.2