summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_uniforms.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-12-13 20:33:08 -0800
committerIan Romanick <[email protected]>2016-12-19 15:55:43 -0800
commitceea514d9192a71b9be87b50b2c63303a54331f9 (patch)
tree5b0b058edada23386ca8698eeaa5dd92a5e22ec1 /src/compiler/glsl/link_uniforms.cpp
parentd32956935edf06c8ae6872c707bc65187b4a1d15 (diff)
linker: Accurately mark a uniform block instance array element as used in a stage
Now that information about which array-of-arrays elements are accessed is tracked, use that information to only mark an instance array element as used-by-stage if, in fact, it is. Fixes GL45-CTS.program_interface_query.uniform-block-types. Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_uniforms.cpp')
-rw-r--r--src/compiler/glsl/link_uniforms.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index 2f851ce8a75..87e9392689c 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -905,7 +905,9 @@ link_update_uniform_buffer_variables(struct gl_linked_shader *shader,
shader->UniformBlocks : shader->ShaderStorageBlocks;
if (var->is_interface_instance()) {
- if (variable_is_referenced(v, var)) {
+ const ir_array_refcount_entry *const entry = v.get_variable_entry(var);
+
+ if (entry->is_referenced) {
/* Since this is an interface instance, the instance type will be
* same as the array-stripped variable type. If the variable type
* is an array, then the block names will be suffixed with [0]
@@ -931,7 +933,9 @@ link_update_uniform_buffer_variables(struct gl_linked_shader *shader,
* be an array of instances, and all elements of the array need
* to be marked as referenced.
*/
- if (strncmp(begin, var->get_interface_type()->name, len) == 0) {
+ if (strncmp(begin, var->get_interface_type()->name, len) == 0 &&
+ (!var->type->is_array() ||
+ entry->is_linearized_index_referenced(blks[i]->linearized_array_index))) {
blks[i]->stageref |= 1U << stage;
}
}