mesa/st: Only one copy of mesa_sysval_to_semantic
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 18 Jun 2014 22:41:44 +0000 (15:41 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 7 Aug 2014 22:19:55 +0000 (15:19 -0700)
Future patches will necessitate changes to the table, and I only want to
update one.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.h
src/mesa/state_tracker/st_mesa_to_tgsi.c

index 101c9f91c16c74b38d01a11274e10b9b6a123dfb..3c8aceef9ae82ec18852afd7c09cacc427135537 100644 (file)
@@ -4238,7 +4238,7 @@ struct st_translate {
 };
 
 /** Map Mesa's SYSTEM_VALUE_x to TGSI_SEMANTIC_x */
-static const unsigned mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
+const unsigned _mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
    TGSI_SEMANTIC_FACE,
    TGSI_SEMANTIC_VERTEXID,
    TGSI_SEMANTIC_INSTANCEID,
@@ -5039,7 +5039,7 @@ st_translate_program(
       unsigned numSys = 0;
       for (i = 0; sysInputs; i++) {
          if (sysInputs & (1 << i)) {
-            unsigned semName = mesa_sysval_to_semantic[i];
+            unsigned semName = _mesa_sysval_to_semantic[i];
             t->systemValues[i] = ureg_DECL_system_value(ureg, numSys, semName, 0);
             if (semName == TGSI_SEMANTIC_INSTANCEID ||
                 semName == TGSI_SEMANTIC_VERTEXID) {
index 2e7cb78d514c9696b20c41ede6bd327bb65ad99d..18f666f5b44fb5ecd55ae5f327cc7d78e94918ec 100644 (file)
@@ -73,6 +73,7 @@ st_translate_stream_output_info(struct glsl_to_tgsi_visitor *glsl_to_tgsi,
                                 const GLuint outputMapping[],
                                 struct pipe_stream_output_info *so);
 
+extern const unsigned _mesa_sysval_to_semantic[SYSTEM_VALUE_MAX];
 
 #ifdef __cplusplus
 }
index 683cd1cac127041e259a88de05787ba08b78943d..26a5f51c77cb2c811ba168b9ada8197984125ab0 100644 (file)
@@ -44,6 +44,7 @@
 #include "util/u_debug.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
+#include "st_glsl_to_tgsi.h" /* for _mesa_sysval_to_semantic */
 
 
 #define PROGRAM_ANY_CONST ((1 << PROGRAM_STATE_VAR) |    \
@@ -96,14 +97,6 @@ struct st_translate {
 };
 
 
-/** Map Mesa's SYSTEM_VALUE_x to TGSI_SEMANTIC_x */
-static unsigned mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
-   TGSI_SEMANTIC_FACE,
-   TGSI_SEMANTIC_VERTEXID,
-   TGSI_SEMANTIC_INSTANCEID
-};
-
-
 /**
  * Make note of a branch to a label in the TGSI code.
  * After we've emitted all instructions, we'll go over the list
@@ -1147,7 +1140,7 @@ st_translate_mesa_program(
       unsigned numSys = 0;
       for (i = 0; sysInputs; i++) {
          if (sysInputs & (1 << i)) {
-            unsigned semName = mesa_sysval_to_semantic[i];
+            unsigned semName = _mesa_sysval_to_semantic[i];
             t->systemValues[i] = ureg_DECL_system_value(ureg, numSys, semName, 0);
             if (semName == TGSI_SEMANTIC_INSTANCEID ||
                 semName == TGSI_SEMANTIC_VERTEXID) {