broadcom/util: don't use compute supergroup packing with subgroups

When using subgroups there are additional restrictions to consider,
so for now we keep it simple and disable supergroup packing in that
scenario.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620>
This commit is contained in:
Iago Toral Quiroga 2021-06-22 12:34:02 +02:00
parent 10313b03b5
commit bf175fbb6a
4 changed files with 10 additions and 0 deletions

View file

@ -29,11 +29,18 @@
*/
uint32_t
v3d_csd_choose_workgroups_per_supergroup(struct v3d_device_info *devinfo,
bool has_subgroups,
bool has_tsy_barrier,
uint32_t threads,
uint32_t num_wgs,
uint32_t wg_size)
{
/* FIXME: subgroups may restrict supergroup packing. For now, we disable it
* completely if the shader uses subgroups.
*/
if (has_subgroups)
return 1;
/* Compute maximum number of batches in a supergroup for this workgroup size.
* Each batch is 16 elements, and we can have up to 16 work groups in a
* supergroup:

View file

@ -28,6 +28,7 @@
uint32_t
v3d_csd_choose_workgroups_per_supergroup(struct v3d_device_info *devinfo,
bool has_subgroups,
bool has_tsy_barrier,
uint32_t threads,
uint32_t num_wgs,

View file

@ -3257,6 +3257,7 @@ cmd_buffer_create_csd_job(struct v3dv_cmd_buffer *cmd_buffer,
uint32_t wgs_per_sg =
v3d_csd_choose_workgroups_per_supergroup(
&cmd_buffer->device->devinfo,
cs_variant->prog_data.cs->has_subgroups,
cs_variant->prog_data.cs->base.has_control_barrier,
cs_variant->prog_data.cs->base.threads,
num_wgs, wg_size);

View file

@ -1556,6 +1556,7 @@ v3d_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info)
uint32_t wgs_per_sg =
v3d_csd_choose_workgroups_per_supergroup(
&v3d->screen->devinfo,
compute->has_subgroups,
compute->base.has_control_barrier,
compute->base.threads,
num_wgs, wg_size);