diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-08-22 09:41:20 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-08-22 09:41:20 -0600 |
commit | 2154d1c5ac0bb37614ef00bed766e49635b519e8 (patch) | |
tree | fc9de64ff06319291c677b4f7d94381cab250b1a /src/mesa | |
parent | d021381d4e17d0c802b6e6b1c11de04563274dea (diff) |
implement negation for src operands
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_fpc_translate.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/mesa/pipe/i915simple/i915_fpc_translate.c b/src/mesa/pipe/i915simple/i915_fpc_translate.c index cf6a142075..6583cbfa28 100644 --- a/src/mesa/pipe/i915simple/i915_fpc_translate.c +++ b/src/mesa/pipe/i915simple/i915_fpc_translate.c @@ -178,11 +178,24 @@ src_vector(struct i915_fp_compile *p, source->SrcRegister.SwizzleZ, source->SrcRegister.SwizzleW); - assert(!source->SrcRegister.Negate); - assert(!source->SrcRegisterExtSwz.NegateX); - assert(!source->SrcRegisterExtSwz.NegateY); - assert(!source->SrcRegisterExtSwz.NegateZ); - assert(!source->SrcRegisterExtSwz.NegateW); + /* There's both negate-all-components and per-component negation. + * Try to handle both here. + */ + { + int nx = source->SrcRegisterExtSwz.NegateX; + int ny = source->SrcRegisterExtSwz.NegateY; + int nz = source->SrcRegisterExtSwz.NegateZ; + int nw = source->SrcRegisterExtSwz.NegateW; + if (source->SrcRegister.Negate) { + nx = !nx; + ny = !ny; + nz = !nz; + nw = !nw; + } + src = negate(src, nx, ny, nz, nw); + } + + /* no abs() or post-abs negation */ assert(!source->SrcRegisterExtMod.Absolute); assert(!source->SrcRegisterExtMod.Negate); |