mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
glsl: fix segfault when indirect indexing a buffer variable which is an array
Fixes a regression added by bb5aeb8549.
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
This commit is contained in:
parent
b0a44f1017
commit
6f3954618b
1 changed files with 2 additions and 1 deletions
|
|
@ -284,7 +284,8 @@ interface_field_name(void *mem_ctx, char *base_name, ir_rvalue *d,
|
|||
if (array_index->type != glsl_type::uint_type)
|
||||
array_index = i2u(array_index);
|
||||
|
||||
if (a->array->type->fields.array->is_array()) {
|
||||
if (a->array->type->is_array() &&
|
||||
a->array->type->fields.array->is_array()) {
|
||||
ir_constant *base_size = new(mem_ctx)
|
||||
ir_constant(a->array->type->fields.array->arrays_of_arrays_size());
|
||||
array_index = mul(array_index, base_size);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue