glsl: fix gl_nir_set_uniform_initializers() for bindless textures
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 24 Mar 2020 03:17:35 +0000 (14:17 +1100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Apr 2020 01:57:34 +0000 (01:57 +0000)
We need to skip opaque variables inside blocks, this is handled
elsewhere and will cause a crash here.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4395>

src/compiler/glsl/gl_nir_link_uniform_initializers.c

index 752eedb63aa066020dccbac501218c22b122309c..fe01b5cb26853e6bcc03a8cad019c9893a130c04 100644 (file)
@@ -278,6 +278,12 @@ gl_nir_set_uniform_initializers(struct gl_context *ctx,
                                     var->type,
                                     var->constant_initializer);
          } else if (var->data.explicit_binding) {
+
+            if (nir_variable_is_in_block(var)) {
+               /* This case is handled by link_uniform_blocks */
+               continue;
+            }
+
             const struct glsl_type *without_array =
                glsl_without_array(var->type);