Mesa (master): gallium/u_vbuf: skip draws with 0 vertices
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jan 28 00:13:26 UTC 2021
Module: Mesa
Branch: master
Commit: be8d811e57973e9d3632f90e47fda1f5c24ca379
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=be8d811e57973e9d3632f90e47fda1f5c24ca379
Author: Marek Olšák <marek.olsak at amd.com>
Date: Tue Jan 26 00:35:10 2021 -0500
gallium/u_vbuf: skip draws with 0 vertices
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8298>
---
src/gallium/auxiliary/util/u_vbuf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index 4775591abad..02d40785f5b 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -1487,11 +1487,14 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info,
new_draw.count = end_vertex - new_draw.start;
new_info.instance_count = end_instance - new_info.start_instance;
- if (new_draw.start == ~0u || !new_draw.count || !new_info.instance_count)
+ if (new_draw.start == ~0u)
goto cleanup;
}
}
+ if (!new_draw.count || !new_info.instance_count)
+ goto cleanup;
+
if (new_info.index_size) {
/* See if anything needs to be done for per-vertex attribs. */
if (u_vbuf_need_minmax_index(mgr)) {
More information about the mesa-commit
mailing list