summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2015-09-23 11:12:57 +1000
committerTimothy Arceri <[email protected]>2015-09-24 10:07:42 +1000
commit827d7948340f4cbc7de2d02971e4f36fbd52f7a8 (patch)
tree734be032ce906a26d36cfd48f301e38830b1a957
parent71e187430cdd1d82972554d7f9e994a41847bea1 (diff)
glsl: correctly detect inactive UBO arrays
Previously the code was trying to get the packing type from the array not the interface. Cc: Ian Romanick <[email protected]> Cc: Antia Puentes <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
-rw-r--r--src/glsl/link_uniform_block_active_visitor.cpp6
-rw-r--r--src/glsl/opt_dead_code.cpp7
2 files changed, 4 insertions, 9 deletions
diff --git a/src/glsl/link_uniform_block_active_visitor.cpp b/src/glsl/link_uniform_block_active_visitor.cpp
index 510294783a0..72e07828a6d 100644
--- a/src/glsl/link_uniform_block_active_visitor.cpp
+++ b/src/glsl/link_uniform_block_active_visitor.cpp
@@ -77,9 +77,6 @@ link_uniform_block_active_visitor::visit(ir_variable *var)
if (!var->is_in_buffer_block())
return visit_continue;
- const glsl_type *const block_type = var->is_interface_instance()
- ? var->type : var->get_interface_type();
-
/* Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec says:
*
* "All members of a named uniform block declared with a shared or
@@ -88,7 +85,8 @@ link_uniform_block_active_visitor::visit(ir_variable *var)
* also considered active, even if no member of the block is
* referenced."
*/
- if (block_type->interface_packing == GLSL_INTERFACE_PACKING_PACKED)
+ if (var->get_interface_type()->interface_packing ==
+ GLSL_INTERFACE_PACKING_PACKED)
return visit_continue;
/* Process the block. Bail if there was an error.
diff --git a/src/glsl/opt_dead_code.cpp b/src/glsl/opt_dead_code.cpp
index e4bf874700c..2cb7f41adef 100644
--- a/src/glsl/opt_dead_code.cpp
+++ b/src/glsl/opt_dead_code.cpp
@@ -119,11 +119,8 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned)
* layouts, do not eliminate it.
*/
if (entry->var->is_in_buffer_block()) {
- const glsl_type *const block_type =
- entry->var->is_interface_instance()
- ? entry->var->type : entry->var->get_interface_type();
-
- if (block_type->interface_packing != GLSL_INTERFACE_PACKING_PACKED)
+ if (entry->var->get_interface_type()->interface_packing !=
+ GLSL_INTERFACE_PACKING_PACKED)
continue;
}