tgsi: Warn if an indirect register not ADDR[0].
authorMichal Krol <michal@tungstengraphics.com>
Sun, 20 Jul 2008 19:28:28 +0000 (21:28 +0200)
committerMichal Krol <michal@tungstengraphics.com>
Sun, 20 Jul 2008 19:28:28 +0000 (21:28 +0200)
src/gallium/auxiliary/tgsi/util/tgsi_sanity.c

index f11de815b06be911a8f635bd4a2b09dec125ef78..08f3995b13e7a858a83177e1134732d4d6578a31 100644 (file)
@@ -171,11 +171,14 @@ iter_instruction(
          inst->FullSrcRegisters[i].SrcRegister.Index,
          inst->FullSrcRegisters[i].SrcRegister.Indirect );
       if (inst->FullSrcRegisters[i].SrcRegister.Indirect) {
-         check_register_usage(
-            ctx,
-            inst->FullSrcRegisters[i].SrcRegisterInd.File,
-            inst->FullSrcRegisters[i].SrcRegisterInd.Index,
-            FALSE );
+         uint file;
+         int index;
+
+         file = inst->FullSrcRegisters[i].SrcRegisterInd.File;
+         index = inst->FullSrcRegisters[i].SrcRegisterInd.Index;
+         check_register_usage( ctx, file, index, FALSE );
+         if (file != TGSI_FILE_ADDRESS || index != 0)
+            report_warning( ctx, "Indirect register not ADDR[0]" );
       }
    }