nir/validate: Allow array derefs of vectors for nir_var_mem_global
authorJason Ekstrand <jason.ekstrand@intel.com>
Sun, 20 Jan 2019 00:54:45 +0000 (18:54 -0600)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 26 Jan 2019 19:39:18 +0000 (13:39 -0600)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
src/compiler/nir/nir_validate.c

index 444c0b789af21e7f41f00f059a316d439ef50c99..17633323dc3b5af9ca39dd53598065e181b0ca56 100644 (file)
@@ -448,7 +448,8 @@ validate_deref_instr(nir_deref_instr *instr, validate_state *state)
       case nir_deref_type_array_wildcard:
          if (instr->mode == nir_var_mem_ubo ||
              instr->mode == nir_var_mem_ssbo ||
-             instr->mode == nir_var_mem_shared) {
+             instr->mode == nir_var_mem_shared ||
+             instr->mode == nir_var_mem_global) {
             /* 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.