nir/validate: Allow array derefs on vectors in more modes
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 14 Dec 2018 00:34:35 +0000 (18:34 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 8 Jan 2019 00:38:30 +0000 (00:38 +0000)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/nir/nir_validate.c

index 9cb6cf27a4e0b8147fc015f975c7f6d07ab530be..dc7b5b5f1128f908f48bed1982fd2882468f82ce 100644 (file)
@@ -448,10 +448,12 @@ validate_deref_instr(nir_deref_instr *instr, validate_state *state)
 
       case nir_deref_type_array:
       case nir_deref_type_array_wildcard:
-         if (instr->mode == nir_var_shared) {
-            /* Shared variables have a bit more relaxed rules because we need
-             * to be able to handle array derefs on vectors.  Fortunately,
-             * nir_lower_io handles these just fine.
+         if (instr->mode == nir_var_ubo ||
+             instr->mode == nir_var_ssbo ||
+             instr->mode == nir_var_shared) {
+            /* Shared variables and UBO/SSBOs have a bit more relaxed rules
+             * because we need to be able to handle array derefs on vectors.
+             * Fortunately, nir_lower_io handles these just fine.
              */
             validate_assert(state, glsl_type_is_array(parent->type) ||
                                    glsl_type_is_matrix(parent->type) ||