summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-07-27 17:12:09 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2017-07-31 10:26:27 +0100
commitd466a7053247fb76f23d7cdaf1745aa9c9bd7fd5 (patch)
tree7009095195121bd1ab5626ab00ebcba1776959e1
parente62eddcdbe3702ba95a833e0565cc3fdd5e23296 (diff)
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> (cherry picked from commit f99e9335e2ca46ec8ead00b63e79f800fec75592)
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index baa835924bc..3983fe75b8d 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -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 =
struct_type->fields.structure[i].memory_coherent;
*memory_volatile =