Instead of falling back to just the block name (which we won't find), look for the first element of the block array. We'll deal with the rest in the backend by arranging for the blocks to be laid out contiguously.
Signed-off-by: Chris Forbes <chr...@ijw.co.nz> --- src/glsl/lower_ubo_reference.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/glsl/lower_ubo_reference.cpp b/src/glsl/lower_ubo_reference.cpp index 90e65bd..85e9c7d 100644 --- a/src/glsl/lower_ubo_reference.cpp +++ b/src/glsl/lower_ubo_reference.cpp @@ -102,6 +102,16 @@ interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d) d = a->array->as_dereference(); previous_index = a->array_index->as_constant(); + + if (!previous_index) { + /* The array index is not a constant, so let's find + * the first element of the array. Elsewhere we guarantee + * that the entire array is valid if used with a non-constant + * index. + */ + previous_index = new(mem_ctx) ir_constant(0u); + } + break; } -- 2.0.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev