mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 20:10:14 +01:00
nir,agx: fix load_active_subgroup_index
It can't be reordered globally, since its value is control-flow dependent. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29179>
This commit is contained in:
parent
7fb60c4c81
commit
eb5f82d221
2 changed files with 2 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ lower(nir_builder *b, nir_intrinsic_instr *intr, void *data)
|
|||
}
|
||||
|
||||
case nir_intrinsic_first_invocation: {
|
||||
nir_def *active_id = nir_load_active_subgroup_invocation_agx(b);
|
||||
nir_def *active_id = nir_load_active_subgroup_invocation_agx(b, 16);
|
||||
nir_def *is_first = nir_ieq_imm(b, active_id, 0);
|
||||
nir_def *first_bit = nir_ballot(b, 1, 32, is_first);
|
||||
nir_def_rewrite_uses(&intr->def, nir_ufind_msb(b, first_bit));
|
||||
|
|
|
|||
|
|
@ -1801,7 +1801,7 @@ intrinsic("load_fep_w_v3d", dest_comp=1, flags=[CAN_ELIMINATE, CAN_REORDER])
|
|||
|
||||
# Active invocation index within the subgroup.
|
||||
# Equivalent to popcount(ballot(true) & ((1 << subgroup_invocation) - 1))
|
||||
system_value("active_subgroup_invocation_agx", 1)
|
||||
intrinsic("load_active_subgroup_invocation_agx", dest_comp=1, flags=[CAN_ELIMINATE])
|
||||
|
||||
# Like ballot() but only within a quad.
|
||||
intrinsic("quad_ballot_agx", src_comp=[1], dest_comp=1, flags=[CAN_ELIMINATE])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue