Mesa (master): tgsi: also count instructions in tgsi_scan_shader()

Brian Paul brianp at kemper.freedesktop.org
Wed May 12 16:39:09 UTC 2010


Module: Mesa
Branch: master
Commit: 6080e567f0ca1fdcce21e76271d4239c33a50db3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6080e567f0ca1fdcce21e76271d4239c33a50db3

Author: Brian Paul <brianp at vmware.com>
Date:   Wed May 12 09:41:41 2010 -0600

tgsi: also count instructions in tgsi_scan_shader()

---

 src/gallium/auxiliary/tgsi/tgsi_scan.c |    7 +++----
 src/gallium/auxiliary/tgsi/tgsi_scan.h |    1 +
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index 232fc53..e0c5d3d 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -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;
 
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
index 741aa7d..27de33f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
@@ -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 */
 




More information about the mesa-commit mailing list