summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-03-25 13:17:31 +1000
committerDave Airlie <[email protected]>2019-03-26 05:16:56 +1000
commitd3836510d21baf427f84fbd11821f91c63d0ea18 (patch)
treea00888cec304b51e1c1ec772d598b535f28bebbf /src/gallium/auxiliary/draw
parent382401aab75d7f4962705868fdf9099d14043472 (diff)
draw: bail instead of assert on instance count (v2)
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 v2: return earlier before changing fpstate Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index be76a30f97c..50286149cd4 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -464,6 +464,9 @@ draw_vbo(struct draw_context *draw,
unsigned fpstate = util_fpstate_get();
struct pipe_draw_info resolved_info;
+ if (info->instance_count == 0)
+ return;
+
/* Make sure that denorms are treated like zeros. This is
* the behavior required by D3D10. OpenGL doesn't care.
*/
@@ -472,7 +475,6 @@ 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->index_size)
assert(draw->pt.user.elts);