summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-05-10 13:10:03 +0200
committerMarek Olšák <[email protected]>2015-06-05 19:44:32 +0200
commit3b1d15775190945b1a639dd9b2581b4032cd2ac6 (patch)
treecf03a06717f1ad7b45b8490e65d70d9247b19f85
parent918ca4031f670066f054cdebcfe68ad75c963ac6 (diff)
tgsi/ureg: rename and simplify ureg_DECL_gs_input
There is nothing special about it and it's used for tessellation shaders too.
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c31
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.h7
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp7
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c7
4 files changed, 25 insertions, 27 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index ca2589ac996..a8f0867cf2f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -116,8 +116,8 @@ struct ureg_program
unsigned index;
unsigned semantic_name;
unsigned semantic_index;
- } gs_input[UREG_MAX_INPUT];
- unsigned nr_gs_inputs;
+ } input[UREG_MAX_INPUT];
+ unsigned nr_inputs;
struct {
unsigned index;
@@ -308,22 +308,23 @@ ureg_DECL_vs_input( struct ureg_program *ureg,
struct ureg_src
-ureg_DECL_gs_input(struct ureg_program *ureg,
- unsigned index,
+ureg_DECL_input(struct ureg_program *ureg,
unsigned semantic_name,
unsigned semantic_index)
{
- if (ureg->nr_gs_inputs < UREG_MAX_INPUT) {
- ureg->gs_input[ureg->nr_gs_inputs].index = index;
- ureg->gs_input[ureg->nr_gs_inputs].semantic_name = semantic_name;
- ureg->gs_input[ureg->nr_gs_inputs].semantic_index = semantic_index;
- ureg->nr_gs_inputs++;
+ int i = 0;
+
+ if (ureg->nr_inputs < UREG_MAX_INPUT) {
+ i = ureg->nr_inputs;
+ ureg->input[i].index = i;
+ ureg->input[i].semantic_name = semantic_name;
+ ureg->input[i].semantic_index = semantic_index;
+ ureg->nr_inputs++;
} else {
set_bad(ureg);
}
- /* XXX: Add suport for true 2D input registers. */
- return ureg_src_register(TGSI_FILE_INPUT, index);
+ return ureg_src_register(TGSI_FILE_INPUT, i);
}
@@ -1498,12 +1499,12 @@ static void emit_decls( struct ureg_program *ureg )
ureg->fs_input[i].array_id);
}
} else {
- for (i = 0; i < ureg->nr_gs_inputs; i++) {
+ for (i = 0; i < ureg->nr_inputs; i++) {
emit_decl_semantic(ureg,
TGSI_FILE_INPUT,
- ureg->gs_input[i].index,
- ureg->gs_input[i].semantic_name,
- ureg->gs_input[i].semantic_index,
+ ureg->input[i].index,
+ ureg->input[i].semantic_name,
+ ureg->input[i].semantic_index,
TGSI_WRITEMASK_XYZW);
}
}
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
index 37846d5be8d..7ad4c93981c 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
@@ -209,10 +209,9 @@ ureg_DECL_vs_input( struct ureg_program *,
unsigned index );
struct ureg_src
-ureg_DECL_gs_input(struct ureg_program *,
- unsigned index,
- unsigned semantic_name,
- unsigned semantic_index);
+ureg_DECL_input(struct ureg_program *,
+ unsigned semantic_name,
+ unsigned semantic_index);
struct ureg_src
ureg_DECL_system_value(struct ureg_program *,
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 72b47b7421b..c1810b69247 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5201,10 +5201,9 @@ st_translate_program(
}
else if (procType == TGSI_PROCESSOR_GEOMETRY) {
for (i = 0; i < numInputs; i++) {
- t->inputs[i] = ureg_DECL_gs_input(ureg,
- i,
- inputSemanticName[i],
- inputSemanticIndex[i]);
+ t->inputs[i] = ureg_DECL_input(ureg,
+ inputSemanticName[i],
+ inputSemanticIndex[i]);
}
for (i = 0; i < numOutputs; i++) {
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index a88d7a87ff4..8efbc6fd69e 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -1095,10 +1095,9 @@ st_translate_mesa_program(
}
else if (procType == TGSI_PROCESSOR_GEOMETRY) {
for (i = 0; i < numInputs; i++) {
- t->inputs[i] = ureg_DECL_gs_input(ureg,
- i,
- inputSemanticName[i],
- inputSemanticIndex[i]);
+ t->inputs[i] = ureg_DECL_input(ureg,
+ inputSemanticName[i],
+ inputSemanticIndex[i]);
}
for (i = 0; i < numOutputs; i++) {