mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-18 18:50:33 +01:00
pan/bi: Use nir_undef_to_zero
We don't handle undefs explicitly in NIR->BIR which means if they aren't optimized out they won't be RA'd to anything and then backend RA will crash (as occurs in a glamor shader seen in MATE). Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7206>
This commit is contained in:
parent
86b2b4eb76
commit
81b28ebcb5
1 changed files with 3 additions and 2 deletions
|
|
@ -1609,8 +1609,7 @@ emit_instr(bi_context *ctx, struct nir_instr *instr)
|
|||
break;
|
||||
|
||||
case nir_instr_type_ssa_undef:
|
||||
/* Spurious */
|
||||
break;
|
||||
unreachable("should've been lowered");
|
||||
|
||||
default:
|
||||
unreachable("Unhandled instruction type");
|
||||
|
|
@ -1852,6 +1851,8 @@ bi_optimize_nir(nir_shader *nir)
|
|||
}
|
||||
|
||||
NIR_PASS(progress, nir, nir_opt_undef);
|
||||
NIR_PASS(progress, nir, nir_undef_to_zero);
|
||||
|
||||
NIR_PASS(progress, nir, nir_opt_loop_unroll,
|
||||
nir_var_shader_in |
|
||||
nir_var_shader_out |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue