zink: lower subgroup width to 1 for unsupported subgroup vote stages

this should handle unsupported gfx subgroup vote

cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16757>
This commit is contained in:
Mike Blumenkrantz 2022-05-31 09:02:06 -04:00 committed by Marge Bot
parent e342a57ea6
commit e1f46524e3
1 changed files with 4 additions and 0 deletions

View File

@ -2203,6 +2203,10 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir,
subgroup_options.ballot_bit_size = 32;
subgroup_options.ballot_components = 4;
subgroup_options.lower_subgroup_masks = true;
if (!(screen->info.subgroup.supportedStages & mesa_to_vk_shader_stage(nir->info.stage))) {
subgroup_options.subgroup_size = 1;
subgroup_options.lower_vote_trivial = true;
}
NIR_PASS_V(nir, nir_lower_subgroups, &subgroup_options);
}