From bd0c677f1b177c552b1ef5a239d6b3da4afb888b Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Sat, 28 Nov 2026 08:26:25 -0500 Subject: [PATCH] borealis: keep render-dependent tiled workgroups at their launch size On HAL200, coalescing tiled compute after a render shortens the compute interval in rt.scene but lengthens the interval before the next render completes. Preserve the launch granularity when the stream records a dependency on a render and the workgroup spans multiple rows. Independent dispatches still use the original coalescing policy. Fixes: 887b5bd7f2f ("borealis: coalesce small pure-global compute workgroups on AGX3") Signed-off-by: DjDeveloperr --- src/asahi/vulkan/hk_cmd_dispatch.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/asahi/vulkan/hk_cmd_dispatch.c b/src/asahi/vulkan/hk_cmd_dispatch.c index 3377f472f5e7..eafc02e5975a 100644 --- a/src/asahi/vulkan/hk_cmd_dispatch.c +++ b/src/asahi/vulkan/hk_cmd_dispatch.c @@ -5174,11 +5174,18 @@ dispatch_grid_shader(struct hk_cmd_buffer *cmd, struct hk_shader *s, : 256u; const uint64_t min_wgs = MAX2(256ull, 4ull * agx_get_num_cores(&dev->dev)); + /* Larger multi-row workgroups on HAL200 can save compute time while + * delaying the next render. Keep the launch granularity for tiled + * dispatches with a recorded dependency on an earlier render. */ + const bool render_dependent = + agx_chip_native_hal200(dev->dev.chip) && local_size.y > 1 && + cs->sync.dep[HK_SYNC_VDM].cut; uint16_t reshaped[3]; - if (hk_coalesce_workgroup_size_ex( - selected->b.info.workgroup_size, grid.count, - dev->vk.physical->properties.maxComputeWorkGroupSize, max_wg, - target_wg, min_wgs, reshaped) || + if ((!render_dependent && + hk_coalesce_workgroup_size_ex( + selected->b.info.workgroup_size, grid.count, + dev->vk.physical->properties.maxComputeWorkGroupSize, max_wg, + target_wg, min_wgs, reshaped)) || hk_split_workgroup_size_ex( selected->b.info.workgroup_size, grid.count, 2ull * agx_get_num_cores(&dev->dev), reshaped)) {