summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_interface_blocks.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-03-11 16:15:02 +1100
committerTimothy Arceri <[email protected]>2016-03-31 12:49:47 +1100
commit8765a9e0fe2987caa6af7473cbc4c55754621806 (patch)
tree3933cacd1356feb8507449fbaccb316c61a4a530 /src/compiler/glsl/link_interface_blocks.cpp
parent7ebc3deaad77d11aa7086720ba4c3469a8878de3 (diff)
glsl: generate named interface block names correctly
Firstly this updates the named interface lowering pass to store the interface without the arrays removed. Note we need to remove the arrays in the interface/varying matching code to not regress things but in future this should be fixed futher as it would seem we currently successfully match interface blocks with differnt array sizes. Since we now know if the interface was an array we can reduce the IR flags from_named_ifc_block_array and from_named_ifc_block_nonarray to just from_named_ifc_block. Next rather than having a different code path for named interface blocks in program_resource_visitor we just make use of the one used by UBOs this allows us to now handle arrays of arrays correctly. Finally we add a new param to the recursion function named_ifc_member this is because we only want to process a single member at a time. Note that this is also the glsl_struct_field from the original ifc type before lowering rather than the type from the lowered variable. This fixes a bug in Mesa where we would generate the names like WithInstArray[0].g[0][0] when it should be WithInstArray[0].g[0] for the following interface. out WithInstArray { float g[3]; } instArray[2]; Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_interface_blocks.cpp')
-rw-r--r--src/compiler/glsl/link_interface_blocks.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/glsl/link_interface_blocks.cpp b/src/compiler/glsl/link_interface_blocks.cpp
index 4c6fb56f891..26072591b0e 100644
--- a/src/compiler/glsl/link_interface_blocks.cpp
+++ b/src/compiler/glsl/link_interface_blocks.cpp
@@ -242,7 +242,8 @@ public:
return entry ? (ir_variable *) entry->data : NULL;
} else {
const struct hash_entry *entry =
- _mesa_hash_table_search(ht, var->get_interface_type()->name);
+ _mesa_hash_table_search(ht,
+ var->get_interface_type()->without_array()->name);
return entry ? (ir_variable *) entry->data : NULL;
}
}
@@ -263,7 +264,8 @@ public:
snprintf(location_str, 11, "%d", var->data.location);
_mesa_hash_table_insert(ht, ralloc_strdup(mem_ctx, location_str), var);
} else {
- _mesa_hash_table_insert(ht, var->get_interface_type()->name, var);
+ _mesa_hash_table_insert(ht,
+ var->get_interface_type()->without_array()->name, var);
}
}