radv: destroy the gang CS when a cmdbuf is reset

Otherwise, if a cmdbuf is recycled it would assume that a gang CS is
always is present even if it's not used. That means, it would emit
useless synchronization and use gang submit with a mostly empty gang
CS for nothing.

It seems better to create the gang CS on-demand only when it's strictly
required (for compute fallback with SDMA and task shaders). Even for
heavy uses of task shaders, that shouldn't hurt.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41543>
This commit is contained in:
Samuel Pitoiset 2026-05-13 15:50:31 +02:00 committed by Marge Bot
parent 937bd7e040
commit 116a0eacd1

View file

@ -1274,8 +1274,10 @@ radv_reset_cmd_buffer(struct vk_command_buffer *vk_cmd_buffer, UNUSED VkCommandB
return;
radv_reset_cmd_stream(device, cs);
if (cmd_buffer->gang.cs)
radv_reset_cmd_stream(device, cmd_buffer->gang.cs);
if (cmd_buffer->gang.cs) {
radv_destroy_cmd_stream(device, cmd_buffer->gang.cs);
cmd_buffer->gang.cs = NULL;
}
list_for_each_entry_safe (struct radv_cmd_buffer_upload, up, &cmd_buffer->upload.list, list) {
radv_rmv_log_command_buffer_bo_destroy(device, up->upload_bo);