summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_lower_io.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-03-18 12:34:09 -0700
committerJason Ekstrand <[email protected]>2015-03-19 13:18:38 -0700
commit639115123efe7f71d432e24b1719adda7d23e97e (patch)
treec43e76da1b94e92fd3891f80710b65cb0ffa5b43 /src/glsl/nir/nir_lower_io.c
parent8f255f948bd5c7b8fd56c8f72f6a9a7f626fca29 (diff)
nir: Use a list instead of a hash_table for inputs, outputs, and uniforms
We never did a single hash table lookup in the entire NIR code base that I found so there was no real benifit to doing it that way. I suppose that for linking, we'll probably want to be able to lookup by name but we can leave building that hash table to the linker. In the mean time this was causing problems with GLSL IR -> NIR because GLSL IR doesn't guarantee us unique names of uniforms, etc. This was causing massive rendering isues in the unreal4 Sun Temple demo. Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_lower_io.c')
-rw-r--r--src/glsl/nir/nir_lower_io.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
index 207f8daa1bc..37c357e893b 100644
--- a/src/glsl/nir/nir_lower_io.c
+++ b/src/glsl/nir/nir_lower_io.c
@@ -77,14 +77,11 @@ type_size(const struct glsl_type *type)
}
static void
-assign_var_locations(struct hash_table *ht, unsigned *size)
+assign_var_locations(struct exec_list *var_list, unsigned *size)
{
unsigned location = 0;
- struct hash_entry *entry;
- hash_table_foreach(ht, entry) {
- nir_variable *var = (nir_variable *) entry->data;
-
+ foreach_list_typed(nir_variable, var, node, var_list) {
/*
* UBO's have their own address spaces, so don't count them towards the
* number of global uniforms
@@ -102,9 +99,9 @@ assign_var_locations(struct hash_table *ht, unsigned *size)
static void
assign_var_locations_shader(nir_shader *shader)
{
- assign_var_locations(shader->inputs, &shader->num_inputs);
- assign_var_locations(shader->outputs, &shader->num_outputs);
- assign_var_locations(shader->uniforms, &shader->num_uniforms);
+ assign_var_locations(&shader->inputs, &shader->num_inputs);
+ assign_var_locations(&shader->outputs, &shader->num_outputs);
+ assign_var_locations(&shader->uniforms, &shader->num_uniforms);
}
static bool