tgsi: also count instructions in tgsi_scan_shader()
authorBrian Paul <brianp@vmware.com>
Wed, 12 May 2010 15:41:41 +0000 (09:41 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 12 May 2010 16:37:59 +0000 (10:37 -0600)
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index 232fc537c1d1dcda2575a23776b9268edbe94b8a..e0c5d3d3d613d28d557eea3360be54ad78ca27d1 100644 (file)
@@ -88,10 +88,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
             assert(fullinst->Instruction.Opcode < TGSI_OPCODE_LAST);
             info->opcode_count[fullinst->Instruction.Opcode]++;
 
-            /* special case: scan fragment shaders for use of the fog
-             * input/attribute.  The X component is fog, the Y component
-             * is the front/back-face flag.
-             */
+            /* check if we read the frag shader FOG or FACE inputs */
             if (procType == TGSI_PROCESSOR_FRAGMENT) {
                uint i;
                for (i = 0; i < fullinst->Instruction.NumSrcRegs; i++) {
@@ -109,6 +106,8 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                   }
                }
             }
+
+            info->num_instructions++;
          }
          break;
 
index 741aa7d5c42a53d5c17dbfccd0cf7df7fa7a2495..27de33f7990c72192ce1247c055a467bd97c66fe 100644 (file)
@@ -54,6 +54,7 @@ struct tgsi_shader_info
    int file_max[TGSI_FILE_COUNT];  /**< highest index of declared registers */
 
    uint immediate_count; /**< number of immediates declared */
+   uint num_instructions;
 
    uint opcode_count[TGSI_OPCODE_LAST];  /**< opcode histogram */