freedreno/ir3+tu: Calculate subgroup size in ir3

TBD if the size changes for a7xx, but at least let's have it in one
place instead of duplicating in turnip and gallium.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
This commit is contained in:
Rob Clark 2023-03-06 07:59:19 -08:00 committed by Marge Bot
parent c449e63809
commit 5eed59cc87
3 changed files with 6 additions and 1 deletions

View file

@ -449,6 +449,10 @@ ir3_collect_info(struct ir3_shader_variant *v)
(compiler->gen >= 6 ? ((info->max_half_reg + 2) / 2) : 0);
info->double_threadsize = ir3_should_double_threadsize(v, regs_count);
/* TODO this is different for earlier gens, but earlier gens don't use this */
info->subgroup_size = v->info.double_threadsize ? 128 : 64;
unsigned reg_independent_max_waves =
ir3_get_reg_independent_max_waves(v, info->double_threadsize);
unsigned reg_dependent_max_waves = ir3_get_reg_dependent_max_waves(

View file

@ -72,6 +72,7 @@ struct ir3_info {
* assuming that they are all executing this shader.
*/
int8_t max_waves;
uint8_t subgroup_size;
bool double_threadsize;
bool multi_dword_ldp_stp;

View file

@ -5283,7 +5283,7 @@ tu_compute_pipeline_create(VkDevice device,
for (int i = 0; i < 3; i++)
pipeline->compute.local_size[i] = v->local_size[i];
pipeline->compute.subgroup_size = v->info.double_threadsize ? 128 : 64;
pipeline->compute.subgroup_size = v->info.subgroup_size;
struct tu_cs prog_cs;
uint32_t additional_reserve_size = tu_xs_get_additional_cs_size_dwords(v);