mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
agx: const fold after discard lowering
to avoid silly xor op with an unconditional discard. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
This commit is contained in:
parent
1006e27627
commit
4071baf1b3
1 changed files with 6 additions and 7 deletions
|
|
@ -3112,14 +3112,13 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key,
|
|||
if (nir->info.stage == MESA_SHADER_FRAGMENT && key->fs.nr_samples) {
|
||||
if (agx_nir_lower_sample_mask(nir, key->fs.nr_samples)) {
|
||||
/* Clean up ixor(bcsel) patterns created from sample mask lowering.
|
||||
* If this succeeds, we'll have expressions to constant fold to get the
|
||||
* benefit. We need to rescalarize after folding constants.
|
||||
* Also constant fold to get the benefit. We need to rescalarize after
|
||||
* folding constants.
|
||||
*/
|
||||
if (agx_nir_opt_ixor_bcsel(nir)) {
|
||||
NIR_PASS_V(nir, nir_opt_constant_folding);
|
||||
NIR_PASS_V(nir, nir_lower_load_const_to_scalar);
|
||||
NIR_PASS_V(nir, nir_opt_dce);
|
||||
}
|
||||
NIR_PASS_V(nir, agx_nir_opt_ixor_bcsel);
|
||||
NIR_PASS_V(nir, nir_opt_constant_folding);
|
||||
NIR_PASS_V(nir, nir_lower_load_const_to_scalar);
|
||||
NIR_PASS_V(nir, nir_opt_dce);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue