st/glsl_to_tgsi: fix getting the image type for array of structs
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 27 Jul 2017 15:12:09 +0000 (17:12 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 28 Jul 2017 09:20:43 +0000 (11:20 +0200)
commitf99e9335e2ca46ec8ead00b63e79f800fec75592
tree14abcbc824aa00b9ec4bc7a789aec88a1a78765b
parentb38c9c57f272b54a190be4efd4297effa1a3deab
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:
arb_bindless_texture/compiler/images/arrays-of-struct.frag

Fixes: 57165f2ef8 ("glsl: disable array splitting for AoA")
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp