mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
tgsi: Saturate modifier obeys ExecMask.
Implement NVIDIA [-1;+1] saturate mode.
This commit is contained in:
parent
6aacca106b
commit
56c30bf17b
1 changed files with 18 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue