nir: Accept nir_var_mem_global in derefs used by phis
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 30 May 2019 20:49:19 +0000 (13:49 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 30 May 2019 21:07:29 +0000 (14:07 -0700)
This mode is used by PhysicalStorageBufferEXT storage class.

Fixes: 8bdf5a008b3 "nir: Allow derefs to be used as phi sources"
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/compiler/nir/nir_validate.c

index 682ed762f57d41ff694fe52beb26de1ffccb3029..204cfdbbe3cddd6c524272237e557b3a33d5e8e5 100644 (file)
@@ -505,7 +505,8 @@ validate_deref_instr(nir_deref_instr *instr, validate_state *state)
       if (use->parent_instr->type == nir_instr_type_phi) {
          validate_assert(state, 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);
       }
    }
 }