From 78d80f7db2fab78b1af96d5acf216d71448d7972 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 28 Nov 2018 17:27:00 -0600 Subject: [PATCH] nir/deref: Skip over casts in fixup_deref_modes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This pass is used when, for instance, we lazily change the mode of variables rather than replacing the variable with a new one. Since we only do this in cases where we know we have full deref chains, it's ok to just skip them in fixup_deref_modes. Reviewed-by: Alejandro Piñeiro Reviewed-by: Caio Marcelo de Oliveira Filho --- src/compiler/nir/nir_deref.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c index edd602a8f4a..a2d46208dd2 100644 --- a/src/compiler/nir/nir_deref.c +++ b/src/compiler/nir/nir_deref.c @@ -272,6 +272,8 @@ nir_fixup_deref_modes(nir_shader *shader) continue; nir_deref_instr *deref = nir_instr_as_deref(instr); + if (deref->deref_type == nir_deref_type_cast) + continue; nir_variable_mode parent_mode; if (deref->deref_type == nir_deref_type_var) { -- 2.30.2