From b0fa3fda3a0bcb53706da72166946b8bcae07c92 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Mon, 24 Jun 2024 08:52:51 +0200 Subject: [PATCH] panvk: Skip dispatch on empty workgroup Fix "dEQP-VK.compute.pipeline.basic.empty_workgroup_*" crashes. Signed-off-by: Mary Guillemard Reviewed-by: Erik Faye-Lund Part-of: --- src/panfrost/vulkan/jm/panvk_vX_cmd_dispatch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/panfrost/vulkan/jm/panvk_vX_cmd_dispatch.c b/src/panfrost/vulkan/jm/panvk_vX_cmd_dispatch.c index e89ffc2dae5..9e8c33e2fd8 100644 --- a/src/panfrost/vulkan/jm/panvk_vX_cmd_dispatch.c +++ b/src/panfrost/vulkan/jm/panvk_vX_cmd_dispatch.c @@ -40,6 +40,9 @@ panvk_per_arch(CmdDispatchBase)(VkCommandBuffer commandBuffer, VK_FROM_HANDLE(panvk_cmd_buffer, cmdbuf, commandBuffer); const struct panvk_shader *shader = cmdbuf->state.compute.shader; + if (groupCountX == 0 || groupCountY == 0 || groupCountZ == 0) + return; + /* If there's no compute shader, we can skip the dispatch. */ if (!panvk_priv_mem_dev_addr(shader->rsd)) return;