If something uses get_variable, it's likely that it doesn't know what to do with casts. If there are any casts in the chain, just return NULL. --- src/compiler/nir/nir.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 8b826d8..00c34f3 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1015,8 +1015,12 @@ nir_deref_instr_parent(const nir_deref_instr *instr) static inline nir_variable * nir_deref_instr_get_variable(const nir_deref_instr *instr) { - while (instr->deref_type != nir_deref_type_var) + while (instr->deref_type != nir_deref_type_var) { + if (instr->deref_type == nir_deref_type_cast) + return NULL; + instr = nir_deref_instr_parent(instr); + } return instr->var; } -- 2.5.0.400.gff86faf _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev