return;
}
- fd_fence_ref(&ctx->last_fence, NULL);
-
/* Upload a user index buffer. */
struct pipe_resource *indexbuf = NULL;
unsigned index_offset = 0;
/* and any buffers used, need to be resolved: */
batch->resolve |= buffers;
+ /* Clearing last_fence must come after the batch dependency tracking
+ * (resource_read()/resource_written()), as that can trigger a flush,
+ * re-populating last_fence
+ */
+ fd_fence_ref(&ctx->last_fence, NULL);
+
DBG("%p: %x %ux%u num_draws=%u (%s/%s)", batch, buffers,
pfb->width, pfb->height, batch->num_draws,
util_format_short_name(pipe_surface_format(pfb->cbufs[0])),
if (!fd_render_condition_check(pctx))
return;
- fd_fence_ref(&ctx->last_fence, NULL);
-
if (ctx->in_discard_blit) {
fd_batch_reset(batch);
fd_context_all_dirty(ctx);
fd_screen_unlock(ctx->screen);
+ /* Clearing last_fence must come after the batch dependency tracking
+ * (resource_read()/resource_written()), as that can trigger a flush,
+ * re-populating last_fence
+ */
+ fd_fence_ref(&ctx->last_fence, NULL);
+
DBG("%p: %x %ux%u depth=%f, stencil=%u (%s/%s)", batch, buffers,
pfb->width, pfb->height, depth, stencil,
util_format_short_name(pipe_surface_format(pfb->cbufs[0])),