[Mesa-stable] [PATCH 02/13] mesa/st: Only one copy of mesa_sysval_to_semantic
Ian Romanick
idr at freedesktop.org
Fri Jun 20 18:00:52 PDT 2014
From: Ian Romanick <ian.d.romanick at intel.com>
Future patches will necessitate changes to the table, and I only want to
update one.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: Marek Olšák <marek.olsak at amd.com>
Cc: Roland Scheidegger <sroland at vmware.com>
Cc: "10.2" <mesa-stable at lists.freedesktop.org>
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 4 ++--
src/mesa/state_tracker/st_glsl_to_tgsi.h | 1 +
src/mesa/state_tracker/st_mesa_to_tgsi.c | 11 ++---------
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 109291d..fd8f270 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4235,7 +4235,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,
@@ -5041,7 +5041,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) {
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.h b/src/mesa/state_tracker/st_glsl_to_tgsi.h
index a3fe91f..a6faa03 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.h
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.h
@@ -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
}
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 683cd1c..26a5f51 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -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) {
--
1.8.1.4
More information about the mesa-stable
mailing list