gallium/u_vbuf: skip non-indirect draws with 0 vertices
authorMarek Olšák <marek.olsak@amd.com>
Tue, 26 Jan 2021 05:35:10 +0000 (00:35 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Feb 2021 00:53:44 +0000 (19:53 -0500)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8770>

src/gallium/auxiliary/util/u_vbuf.c

index 4775591..6f4e912 100644 (file)
@@ -1490,6 +1490,9 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info,
          if (new_draw.start == ~0u || !new_draw.count || !new_info.instance_count)
             goto cleanup;
       }
+   } else {
+      if ((!indirect && !new_draw.count) || !new_info.instance_count)
+         goto cleanup;
    }
 
    if (new_info.index_size) {