[Mesa-dev] [PATCH] draw: bail instead of assert on instance count

Dave Airlie airlied at gmail.com
Mon Mar 25 03:20:23 UTC 2019


From: Dave Airlie <airlied at redhat.com>

With indirect rendering it's fine to set the instance count
parameter to 0, and expect the rendering to be ignored.

Fixes assert in KHR-GLES31.core.compute_shader.pipeline-gen-draw-commands
on softpipe
---
 src/gallium/auxiliary/draw/draw_pt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index be76a30f97c..62de435e903 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -472,7 +472,9 @@ draw_vbo(struct draw_context *draw,
    resolve_draw_info(info, &resolved_info, &(draw->pt.vertex_buffer[0]));
    info = &resolved_info;
 
-   assert(info->instance_count > 0);
+   if (info->instance_count == 0)
+      return;
+
    if (info->index_size)
       assert(draw->pt.user.elts);
 
-- 
2.20.1



More information about the mesa-dev mailing list