mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-30 21:21:39 +02:00
nir/lower_subgroups: add filter
this will be useful for AGX, which has many reductions (but not all) in hardware with the logic too backend-specific to encode with bitflags. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28993>
This commit is contained in:
parent
3990463c48
commit
8b070c36ec
2 changed files with 8 additions and 2 deletions
|
|
@ -5796,6 +5796,12 @@ bool nir_lower_is_helper_invocation(nir_shader *shader);
|
|||
bool nir_lower_single_sampled(nir_shader *shader);
|
||||
|
||||
typedef struct nir_lower_subgroups_options {
|
||||
/* In addition to the boolean lowering options below, this optional callback
|
||||
* will filter instructions for lowering if non-NULL. The data passed will be
|
||||
* this options struct itself.
|
||||
*/
|
||||
nir_instr_filter_cb filter;
|
||||
|
||||
uint8_t subgroup_size;
|
||||
uint8_t ballot_bit_size;
|
||||
uint8_t ballot_components;
|
||||
|
|
|
|||
|
|
@ -1090,8 +1090,8 @@ bool
|
|||
nir_lower_subgroups(nir_shader *shader,
|
||||
const nir_lower_subgroups_options *options)
|
||||
{
|
||||
return nir_shader_lower_instructions(shader,
|
||||
lower_subgroups_filter,
|
||||
void *filter = options->filter ? options->filter : lower_subgroups_filter;
|
||||
return nir_shader_lower_instructions(shader, filter,
|
||||
lower_subgroups_instr,
|
||||
(void *)options);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue