Mesa (master): vc4: Sanity check that flushes don' t happen between state emit and draw.

Eric Anholt anholt at kemper.freedesktop.org
Mon Apr 18 17:11:11 UTC 2016


Module: Mesa
Branch: master
Commit: 9e8a8b0c8be4a5e0542c915b982f04f25b34b2d8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e8a8b0c8be4a5e0542c915b982f04f25b34b2d8

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Apr 15 13:43:14 2016 -0700

vc4: Sanity check that flushes don't happen between state emit and draw.

Catches the cause of failure in
arb_vertex_buffer_object-mixed-immediate-and-vbo, I've had this class of
failure before, and it probably won't be the last time.

---

 src/gallium/drivers/vc4/vc4_draw.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index 68b8573..cf3f5e0 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -296,6 +296,7 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
         vc4_start_draw(vc4, info->count);
         vc4_update_compiled_shaders(vc4, info->mode);
 
+        uint32_t start_draw_calls_queued = vc4->draw_calls_queued;
         vc4_emit_state(pctx);
 
         if ((vc4->dirty & (VC4_DIRTY_VTXBUF |
@@ -425,6 +426,12 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
         }
         cl_end(&vc4->bcl, bcl);
 
+        /* No flushes of the job should have happened between when we started
+         * emitting state for our draw and when we just emitted our draw's
+         * primitives.
+         */
+        assert(start_draw_calls_queued == vc4->draw_calls_queued);
+
         if (vc4->zsa && vc4->zsa->base.depth.enabled) {
                 vc4->resolve |= PIPE_CLEAR_DEPTH;
         }




More information about the mesa-commit mailing list