diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 2237208a918..afedab3e979 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -1803,6 +1803,9 @@ intrinsic("load_fep_w_v3d", dest_comp=1, flags=[CAN_ELIMINATE, CAN_REORDER]) # Equivalent to popcount(ballot(true) & ((1 << subgroup_invocation) - 1)) system_value("active_subgroup_invocation_agx", 1) +# Like ballot() but only within a quad. +intrinsic("quad_ballot_agx", src_comp=[1], dest_comp=1, flags=[CAN_ELIMINATE]) + # With [0, 1] clipping, no transform is needed on the output z' = z. But with [-1, # 1] clipping, we need to transform z' = (z + w) / 2. We express both cases as a # lerp between z and w, where this is the lerp coefficient: 0 for [0, 1] and 0.5