util/draw: fix indirect draw count readback
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 19 Apr 2022 20:06:44 +0000 (16:06 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 21 Apr 2022 02:29:09 +0000 (02:29 +0000)
if there is an indirect count, always use it

Fixes: 3eb99323172 ("aux/draw: add a util function for reading back indirect draw params")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>

src/gallium/auxiliary/util/u_draw.c

index 273724f..ed1e294 100644 (file)
@@ -150,8 +150,7 @@ util_draw_indirect_read(struct pipe_context *pipe,
          debug_printf("%s: failed to map indirect draw count buffer\n", __FUNCTION__);
          return NULL;
       }
-      if (dc_param[0] < draw_count)
-         draw_count = dc_param[0];
+      draw_count = dc_param[0];
       pipe_buffer_unmap(pipe, dc_transfer);
    }
    if (!draw_count) {