glsl: don't validate array types in ir_dereference_variable
authorMarek Olšák <marek.olsak@amd.com>
Wed, 8 Jul 2020 22:37:34 +0000 (18:37 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 8 Jul 2020 23:22:17 +0000 (23:22 +0000)
Fixes: 8d62969cfe8 - glsl: validate more stuff
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3245
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5813>

src/compiler/glsl/ir_validate.cpp

index 426862c039cfbfcc80cd9a6e7c388349796b315b..c9d5ca1e3567f5671334c1e43e82eae4af0c93af 100644 (file)
@@ -98,7 +98,10 @@ ir_validate::visit(ir_dereference_variable *ir)
       abort();
    }
 
-   if (ir->var->type != ir->type) {
+   /* Compare types without arrays, because one side can be sized and
+    * the other unsized.
+    */
+   if (ir->var->type->without_array() != ir->type->without_array()) {
       printf("ir_dereference_variable type is not equal to variable type: ");
       ir->print();
       printf("\n");