diff options
author | Alyssa Rosenzweig <alyssa@rosenzweig.io> | 2024-06-17 16:58:20 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <alyssa@rosenzweig.io> | 2024-06-22 10:09:45 -0400 |
commit | 27e3495902e844b29062d0e9770c4b20ff6d0335 (patch) | |
tree | 01b61fdc9ea138732ac33e8e489f98c38d4aa682 /src/asahi | |
parent | 7dd73290fb5af00248aa43129f0ceeedfb4a55cb (diff) |
agx: set discard_is_demote
this is simpler/more correct.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29861>
Diffstat (limited to 'src/asahi')
-rw-r--r-- | src/asahi/compiler/agx_compile.h | 1 | ||||
-rw-r--r-- | src/asahi/compiler/agx_nir_lower_discard_zs_emit.c | 7 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/asahi/compiler/agx_compile.h b/src/asahi/compiler/agx_compile.h index a96af8fcc9f..1fd7c25695f 100644 --- a/src/asahi/compiler/agx_compile.h +++ b/src/asahi/compiler/agx_compile.h @@ -301,4 +301,5 @@ static const nir_shader_compiler_options agx_nir_options = { .lower_doubles_options = (nir_lower_doubles_options)(~0), .lower_fquantize2f16 = true, .compact_arrays = true, + .discard_is_demote = true, }; diff --git a/src/asahi/compiler/agx_nir_lower_discard_zs_emit.c b/src/asahi/compiler/agx_nir_lower_discard_zs_emit.c index 579b9ad5910..d4535d02817 100644 --- a/src/asahi/compiler/agx_nir_lower_discard_zs_emit.c +++ b/src/asahi/compiler/agx_nir_lower_discard_zs_emit.c @@ -83,9 +83,7 @@ lower_zs_emit(nir_block *block, bool force_early_z) static bool lower_discard(nir_builder *b, nir_intrinsic_instr *intr, UNUSED void *data) { - if (intr->intrinsic != nir_intrinsic_terminate && - intr->intrinsic != nir_intrinsic_terminate_if && - intr->intrinsic != nir_intrinsic_demote && + if (intr->intrinsic != nir_intrinsic_demote && intr->intrinsic != nir_intrinsic_demote_if) return false; @@ -95,8 +93,7 @@ lower_discard(nir_builder *b, nir_intrinsic_instr *intr, UNUSED void *data) nir_def *no_samples = nir_imm_intN_t(b, 0, 16); nir_def *killed_samples = all_samples; - if (intr->intrinsic == nir_intrinsic_terminate_if || - intr->intrinsic == nir_intrinsic_demote_if) + if (intr->intrinsic == nir_intrinsic_demote_if) killed_samples = nir_bcsel(b, intr->src[0].ssa, all_samples, no_samples); /* This will get lowered later as needed */ |