Mesa (master): tgsi: Drop uses_fogcoord and uses_frontfacing from tgsi_scan .

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Jun 1 08:39:11 PDT 2010


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Jun  1 16:37:32 2010 +0100

tgsi: Drop uses_fogcoord and uses_frontfacing from tgsi_scan.

It was not used anywhere; the code was buggy (it didn't take care of
indirect registers and could potential cause buffer underflows) and the
same effect can now be easily achieved by just by looking at
input_semantic_name[] and input_usage_mask[].

---

 src/gallium/auxiliary/tgsi/tgsi_scan.c |   14 --------------
 src/gallium/auxiliary/tgsi/tgsi_scan.h |    2 --
 2 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index 7ee272b..ced9c94 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -95,20 +95,6 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                   &fullinst->Src[i];
                int ind = src->Register.Index;
 
-               /* check if we read the frag shader FOG or FACE inputs */
-               if (procType == TGSI_PROCESSOR_FRAGMENT) {
-                  if (src->Register.File == TGSI_FILE_INPUT ||
-                      src->Register.File == TGSI_FILE_SYSTEM_VALUE) {
-                     assert(ind >= 0);
-                     if (info->input_semantic_name[ind] == TGSI_SEMANTIC_FOG) {
-                        info->uses_fogcoord = TRUE;
-                     }
-                     else if (info->input_semantic_name[ind] == TGSI_SEMANTIC_FACE) {
-                        info->uses_frontfacing = TRUE;
-                     }
-                  }
-               }
-
                /* Mark which inputs are effectively used */
                if (src->Register.File == TGSI_FILE_INPUT) {
                   unsigned usage_mask;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
index f435414..e752803 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
@@ -62,8 +62,6 @@ struct tgsi_shader_info
    boolean writes_z;  /**< does fragment shader write Z value? */
    boolean writes_edgeflag; /**< vertex shader outputs edgeflag */
    boolean uses_kill;  /**< KIL or KILP instruction used? */
-   boolean uses_fogcoord; /**< fragment shader uses fog coord? */
-   boolean uses_frontfacing; /**< fragment shader uses front/back-face flag? */
 
    struct {
       unsigned name;



More information about the mesa-commit mailing list