Mesa (gallium-edgeflags): gallium: store edgflag info in tgsi_shader_info

Roland Scheidegger sroland at kemper.freedesktop.org
Fri Dec 18 23:19:42 UTC 2009


Module: Mesa
Branch: gallium-edgeflags
Commit: ff5b0c72db20be099f9fc7dee22aeebbda75ab42
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff5b0c72db20be099f9fc7dee22aeebbda75ab42

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Fri Dec 18 23:53:25 2009 +0100

gallium: store edgflag info in tgsi_shader_info

provides easier access for drivers which may base fallback decision on this

---

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

diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index a5d2db0..ebee000 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -138,15 +138,19 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                   info->output_semantic_name[reg] = (ubyte)fulldecl->Semantic.Name;
                   info->output_semantic_index[reg] = (ubyte)fulldecl->Semantic.Index;
                   info->num_outputs++;
-               }
 
-               /* special case */
-               if (procType == TGSI_PROCESSOR_FRAGMENT &&
-                   file == TGSI_FILE_OUTPUT &&
-                   fulldecl->Semantic.Name == TGSI_SEMANTIC_POSITION) {
-                  info->writes_z = TRUE;
+                  /* extra info for special outputs */
+                  if (procType == TGSI_PROCESSOR_FRAGMENT &&
+                      fulldecl->Semantic.Name == TGSI_SEMANTIC_POSITION) {
+                     info->writes_z = TRUE;
+                  }
+                  if (procType == TGSI_PROCESSOR_VERTEX &&
+                      fulldecl->Semantic.Name == TGSI_SEMANTIC_EDGEFLAG) {
+                     info->writes_edgeflag = TRUE;
+                  }
                }
-            }
+
+             }
          }
          break;
 
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
index 8a7ee0c..3ce0e88 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
@@ -58,6 +58,7 @@ struct tgsi_shader_info
    uint opcode_count[TGSI_OPCODE_LAST];  /**< opcode histogram */
 
    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? */




More information about the mesa-commit mailing list