aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-01-07 23:37:53 +0100
committerMarek Olšák <[email protected]>2016-01-08 20:06:22 +0100
commitc07cf5f5a92d3c7d433a05a06faf9d262a732f4a (patch)
treee3503108bbc5960cb4edaf2657e6258ebb594b88 /src/gallium
parentc886422656f38593e1db3700ae747058f55125d4 (diff)
tgsi/ureg: handle redundant declarations in ureg_DECL_system_value
Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 964272386b3..5b78542413e 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -322,7 +322,14 @@ ureg_DECL_system_value(struct ureg_program *ureg,
unsigned semantic_name,
unsigned semantic_index)
{
- unsigned i = 0;
+ unsigned i;
+
+ for (i = 0; i < ureg->nr_system_values; i++) {
+ if (ureg->system_value[i].semantic_name == semantic_name &&
+ ureg->system_value[i].semantic_index == semantic_index) {
+ goto out;
+ }
+ }
if (ureg->nr_system_values < UREG_MAX_SYSTEM_VALUE) {
ureg->system_value[ureg->nr_system_values].semantic_name = semantic_name;
@@ -333,6 +340,7 @@ ureg_DECL_system_value(struct ureg_program *ureg,
set_bad(ureg);
}
+out:
return ureg_src_register(TGSI_FILE_SYSTEM_VALUE, i);
}