From: Brian Paul Date: Tue, 31 Mar 2009 20:25:32 +0000 (-0600) Subject: i965: do negation and Abs in get_src_reg_imm() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a9c62a2340794977a87cba4a352c02fc16f81505;p=mesa.git i965: do negation and Abs in get_src_reg_imm() Fixes regression seen with progs/glsl/bump.c --- 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);