Commit d466a705 authored by Samuel Pitoiset's avatar Samuel Pitoiset Committed by Emil Velikov

st/glsl_to_tgsi: fix getting the image type for array of structs

Since array splitting for AoA is disabled, we have to retrieve
the type of the first non-array type when an array of images is
declared inside a structure. Otherwise, it will hit an assert
in glsl_type::sampler_index() because it expects either a sampler
or an image type.

This fixes a regression in the following piglit test:

Fixes: 57165f2e ("glsl: disable array splitting for AoA")
Cc: 17.2 <>
Signed-off-by: Samuel Pitoiset's avatarSamuel Pitoiset <>
Reviewed-by: default avatarMarek Olšák <>
(cherry picked from commit f99e9335)
parent e62eddcd
......@@ -3790,7 +3790,7 @@ get_image_qualifiers(ir_dereference *ir, const glsl_type **type,
for (unsigned i = 0; i < struct_type->length; i++) {
if (!strcmp(struct_type->fields.structure[i].name,
deref_record->field)) {
*type = struct_type->fields.structure[i].type;
*type = struct_type->fields.structure[i].type->without_array();
*memory_coherent =
*memory_volatile =
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment