From 12fa219768c56cf7744a1adc3d9f63e3e686176a Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 15 Feb 2021 00:23:40 -0600 Subject: [PATCH] nir/opt_large_constants: Handle generic pointers We already throw out any variables which may have a complex use so we just need to make sure that our mode checks don't assert if we have a deref which may_be but not must_be nir_var_function_temp. Reviewed-by: Caio Marcelo de Oliveira Filho Part-of: --- src/compiler/nir/nir_opt_large_constants.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_large_constants.c b/src/compiler/nir/nir_opt_large_constants.c index 88e0e0b9485..60f2b5837d6 100644 --- a/src/compiler/nir/nir_opt_large_constants.c +++ b/src/compiler/nir/nir_opt_large_constants.c @@ -238,7 +238,7 @@ nir_opt_large_constants(nir_shader *shader, continue; } - if (dst_deref && nir_deref_mode_is(dst_deref, nir_var_function_temp)) { + if (dst_deref && nir_deref_mode_must_be(dst_deref, nir_var_function_temp)) { nir_variable *var = nir_deref_instr_get_variable(dst_deref); if (var == NULL) continue; @@ -266,7 +266,7 @@ nir_opt_large_constants(nir_shader *shader, } } - if (src_deref && nir_deref_mode_is(src_deref, nir_var_function_temp)) { + if (src_deref && nir_deref_mode_must_be(src_deref, nir_var_function_temp)) { nir_variable *var = nir_deref_instr_get_variable(src_deref); if (var == NULL) continue;