u/draw: skip zero-sized indirect draws
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 11 Aug 2023 11:24:58 +0000 (07:24 -0400)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Aug 2023 15:32:26 +0000 (15:32 +0000)
cc: mesa-stable

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24631>

src/gallium/auxiliary/util/u_draw.c

index 683c9c1..454aff7 100644 (file)
@@ -223,6 +223,9 @@ util_draw_indirect(struct pipe_context *pipe,
       pipe_buffer_unmap(pipe, dc_transfer);
    }
 
+   if (!draw_count)
+      return;
+
    if (indirect->stride)
       num_params = MIN2(indirect->stride / 4, num_params);
    params = (uint32_t *)