tgsi: keep immediate file info uptodate
authorKeith Whitwell <keith@tungstengraphics.com>
Thu, 12 Feb 2009 13:30:01 +0000 (13:30 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Thu, 12 Feb 2009 13:30:01 +0000 (13:30 +0000)
Make sure the stats for TGSI_FILE_IMMEDIATE are uptodate.  Previously
we just had immediate_count, but file_*[TGSI_FILE_IMMEDIATE] were
bogus.

src/gallium/auxiliary/tgsi/tgsi_scan.c

index d02205a63ef76b471a559d64062099f1af60f011..c535788819f99f068effe3606a8ff59aad767348 100644 (file)
@@ -151,7 +151,14 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
          break;
 
       case TGSI_TOKEN_TYPE_IMMEDIATE:
-         info->immediate_count++;
+         {
+            uint reg = info->immediate_count++;
+            uint file = TGSI_FILE_IMMEDIATE;
+
+            info->file_mask[file] |= (1 << reg);
+            info->file_count[file]++;
+            info->file_max[file] = MAX2(info->file_max[file], (int)reg);
+         }
          break;
 
       default: