turnip: do nothing on dispatch with zero total workgroups
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Wed, 6 Oct 2021 15:02:26 +0000 (18:02 +0300)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 Oct 2021 23:53:03 +0000 (23:53 +0000)
Otherwise GPU hangs...

Fixes vkd3d test "test_dispatch_zero_thread_groups"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13227>

src/freedreno/vulkan/tu_cmd_buffer.c

index 285e3c1..af7499b 100644 (file)
@@ -4483,6 +4483,10 @@ static void
 tu_dispatch(struct tu_cmd_buffer *cmd,
             const struct tu_dispatch_info *info)
 {
+   if (!info->indirect &&
+       (info->blocks[0] == 0 || info->blocks[1] == 0 || info->blocks[2] == 0))
+      return;
+
    struct tu_cs *cs = &cmd->cs;
    struct tu_pipeline *pipeline = cmd->state.compute_pipeline;
    struct tu_descriptor_state *descriptors_state =