Mesa (main): turnip: do nothing on dispatch with zero total workgroups

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 7 00:13:13 UTC 2021


Module: Mesa
Branch: main
Commit: 127352457cd5bfecf6d9f4e42dddc04c5334c4d1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=127352457cd5bfecf6d9f4e42dddc04c5334c4d1

Author: Danylo Piliaiev <dpiliaiev at igalia.com>
Date:   Wed Oct  6 18:02:26 2021 +0300

turnip: do nothing on dispatch with zero total workgroups

Otherwise GPU hangs...

Fixes vkd3d test "test_dispatch_zero_thread_groups"

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

---

 src/freedreno/vulkan/tu_cmd_buffer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c
index 285e3c173a5..af7499bc189 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.c
+++ b/src/freedreno/vulkan/tu_cmd_buffer.c
@@ -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 =



More information about the mesa-commit mailing list