From a3c9a2881e242b9ac588d6dcb158e805fefe352d Mon Sep 17 00:00:00 2001 From: Andrii Simiklit Date: Tue, 5 Mar 2019 17:38:20 +0200 Subject: [PATCH] glsl: fix an incorrect max_array_access after optimization of ssbo/ubo This is needed to fix these tests: piglit.spec.arb_shader_storage_buffer_object.compiler.unused-array-element_frag piglit.spec.arb_shader_storage_buffer_object.compiler.unused-array-element_comp Fixes: 8cf1333b "glsl: link uniform block arrays of arrays" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109532 Reported-By: Ilia Mirkin Tested-by: Fritz Koenig Signed-off-by: Andrii Simiklit Reviewed-by: Kristian H. Kristensen --- src/compiler/glsl/link_uniform_blocks.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/glsl/link_uniform_blocks.cpp b/src/compiler/glsl/link_uniform_blocks.cpp index 45f1c0fe98d..715118cf509 100644 --- a/src/compiler/glsl/link_uniform_blocks.cpp +++ b/src/compiler/glsl/link_uniform_blocks.cpp @@ -440,6 +440,7 @@ link_uniform_blocks(void *mem_ctx, GLSL_INTERFACE_PACKING_PACKED)) { b->type = resize_block_array(b->type, b->array); b->var->type = b->type; + b->var->data.max_array_access = b->type->length - 1; } block_size.num_active_uniforms = 0; -- 2.30.2