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 <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9068>
This commit is contained in:
Jason Ekstrand 2021-02-15 00:23:40 -06:00 committed by Marge Bot
parent 8b133a1b25
commit 12fa219768

View file

@ -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;