From 52dd43c7ef39ab2432449a557660260e054f262a Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 13 Dec 2018 18:34:35 -0600 Subject: [PATCH] nir/validate: Allow array derefs on vectors in more modes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Alejandro Piñeiro Reviewed-by: Caio Marcelo de Oliveira Filho --- src/compiler/nir/nir_validate.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c index 9cb6cf27a4e..dc7b5b5f112 100644 --- a/src/compiler/nir/nir_validate.c +++ b/src/compiler/nir/nir_validate.c @@ -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) || -- 2.30.2