gallium: added some sanity check assertions for constant buffer indexing

This commit is contained in:
Brian Paul
2008-11-05 13:55:56 -07:00
parent 528c860a58
commit a137f03c56
+4
View File
@@ -958,6 +958,10 @@ 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];