diff options
author | Michal Krol <michal@tungstengraphics.com> | 2008-08-18 17:09:20 +0200 |
---|---|---|
committer | Michal Krol <michal@tungstengraphics.com> | 2008-08-18 17:20:12 +0200 |
commit | 56c30bf17b9f57efdb93ae5d1b801677535a9651 (patch) | |
tree | ff8196e6703c69fd5de51f3a84d5d674c2c0a97e /src/gallium/auxiliary/tgsi | |
parent | 6aacca106b0619d87015aece1a0b1d6332910926 (diff) |
tgsi: Saturate modifier obeys ExecMask.
Implement NVIDIA [-1;+1] saturate mode.
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_exec.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 1217ee71a5..dfd22270c8 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -1263,13 +1263,27 @@ store_dest( break; case TGSI_SAT_ZERO_ONE: - /* XXX need to obey ExecMask here */ - micro_max( dst, chan, &mach->Temps[TEMP_0_I].xyzw[TEMP_0_C] ); - micro_min( dst, dst, &mach->Temps[TEMP_1_I].xyzw[TEMP_1_C] ); + for (i = 0; i < QUAD_SIZE; i++) + if (execmask & (1 << i)) { + if (chan->f[i] < 0.0f) + dst->f[i] = 0.0f; + else if (chan->f[i] > 1.0f) + dst->f[i] = 1.0f; + else + dst->i[i] = chan->i[i]; + } break; case TGSI_SAT_MINUS_PLUS_ONE: - assert( 0 ); + for (i = 0; i < QUAD_SIZE; i++) + if (execmask & (1 << i)) { + if (chan->f[i] < -1.0f) + dst->f[i] = -1.0f; + else if (chan->f[i] > 1.0f) + dst->f[i] = 1.0f; + else + dst->i[i] = chan->i[i]; + } break; default: |