i965: do negation and Abs in get_src_reg_imm()
authorBrian Paul <brianp@vmware.com>
Tue, 31 Mar 2009 20:25:32 +0000 (14:25 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 3 Apr 2009 15:07:04 +0000 (09:07 -0600)
Fixes regression seen with progs/glsl/bump.c

src/mesa/drivers/dri/i965/brw_wm_glsl.c

index 4e99611be81d3003d76660ac1b7a6d1986651d39..67ba59c3252a0223c7e8820068a0ee348671bc96 100644 (file)
@@ -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);