glsl: fix gl_nir_set_uniform_initializers() for image arrays
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 10 Feb 2020 00:22:32 +0000 (11:22 +1100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 14 Feb 2020 01:37:03 +0000 (01:37 +0000)
The if was incorrectly checking for an image type on what could
be an array of images. Here we change it to use the type stored
in uniform storage which has already been stripped of arrays,
this is what the above code for samplers does also.

Fixes: 2bf91733fcb5 ("nir/linker: Set the uniform initial values")
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3757>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3757>

src/compiler/glsl/gl_nir_link_uniform_initializers.c

index 1c4529c9307088bd3604145ffb732200c44fdc60..752eedb63aa066020dccbac501218c22b122309c 100644 (file)
@@ -87,7 +87,7 @@ set_opaque_binding(struct set_opaque_binding_closure *data,
                   storage->storage[i].i;
             }
          }
-      } else if (glsl_type_is_image(type)) {
+      } else if (glsl_type_is_image(storage->type)) {
          for (unsigned i = 0; i < elements; i++) {
             const unsigned index = storage->opaque[sh].index + i;