mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 20:10:24 +01:00
tgsi: Return 0.0 for negative constant register indices.
This commit is contained in:
parent
957f7d7d94
commit
d86ffcffb3
1 changed files with 16 additions and 8 deletions
|
|
@ -947,14 +947,22 @@ fetch_src_file_channel(
|
|||
switch( file ) {
|
||||
case TGSI_FILE_CONSTANT:
|
||||
assert(mach->Consts);
|
||||
assert(index->i[0] >= 0);
|
||||
assert(index->i[1] >= 0);
|
||||
assert(index->i[2] >= 0);
|
||||
assert(index->i[3] >= 0);
|
||||
chan->f[0] = mach->Consts[index->i[0]][swizzle];
|
||||
chan->f[1] = mach->Consts[index->i[1]][swizzle];
|
||||
chan->f[2] = mach->Consts[index->i[2]][swizzle];
|
||||
chan->f[3] = mach->Consts[index->i[3]][swizzle];
|
||||
if (index->i[0] < 0)
|
||||
chan->f[0] = 0.0f;
|
||||
else
|
||||
chan->f[0] = mach->Consts[index->i[0]][swizzle];
|
||||
if (index->i[1] < 0)
|
||||
chan->f[1] = 0.0f;
|
||||
else
|
||||
chan->f[1] = mach->Consts[index->i[1]][swizzle];
|
||||
if (index->i[2] < 0)
|
||||
chan->f[2] = 0.0f;
|
||||
else
|
||||
chan->f[2] = mach->Consts[index->i[2]][swizzle];
|
||||
if (index->i[3] < 0)
|
||||
chan->f[3] = 0.0f;
|
||||
else
|
||||
chan->f[3] = mach->Consts[index->i[3]][swizzle];
|
||||
break;
|
||||
|
||||
case TGSI_FILE_INPUT:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue