gallium/u_threaded: clear vertices_per_patch if prim type != PATCHES
authorMarek Olšák <marek.olsak@amd.com>
Sun, 22 Nov 2020 03:19:46 +0000 (22:19 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 5 Jan 2021 00:22:33 +0000 (19:22 -0500)
We use memcmp when combining back-to-back draws into a multi draw.
Clear vertices_per_patch if it's irrelevant to help memcmp return
a match.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>

src/gallium/auxiliary/util/u_threaded_context.c

index 4b60cc7..c654d63 100644 (file)
@@ -105,6 +105,9 @@ simplify_draw_info(struct pipe_draw_info *info)
    /* This shouldn't be set when merging single draws. */
    info->increment_draw_id = false;
 
+   if (info->mode != PIPE_PRIM_PATCHES)
+      info->vertices_per_patch = 0;
+
    if (info->index_size) {
       if (!info->primitive_restart)
          info->restart_index = 0;