glsl: handle format layout qualifiers for struct with array of images
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 25 May 2017 14:26:42 +0000 (16:26 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 1 Jun 2017 09:54:06 +0000 (11:54 +0200)
This handles a situation like:

struct {
   layout (r32f) image2D imgs[6];
} s;

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/ast_to_hir.cpp

index 65b6262..e451bda 100644 (file)
@@ -7434,7 +7434,8 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
 
             if (field_type->without_array()->is_image()) {
                if (qual->flags.q.explicit_image_format) {
-                  if (qual->image_base_type != field_type->sampled_type) {
+                  if (qual->image_base_type !=
+                      field_type->without_array()->sampled_type) {
                      _mesa_glsl_error(&loc, state, "format qualifier doesn't "
                                       "match the base data type of the image");
                   }