From dacf22e0a34d4dc2595f3cb0dbee52318dc9d0d7 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Thu, 2 Apr 2015 20:48:44 -0400 Subject: freedreno: mark resources as being read so that writes flush the queue Signed-off-by: Ilia Mirkin --- src/gallium/drivers/freedreno/freedreno_context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gallium/drivers/freedreno/freedreno_context.c') diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c index bb1b52797a8..5fca57c5a3a 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.c +++ b/src/gallium/drivers/freedreno/freedreno_context.c @@ -95,6 +95,7 @@ fd_context_render(struct pipe_context *pctx) { struct fd_context *ctx = fd_context(pctx); struct pipe_framebuffer_state *pfb = &ctx->framebuffer; + struct fd_resource *rsc, *rsc_tmp; int i; DBG("needs_flush: %d", ctx->needs_flush); @@ -122,6 +123,15 @@ fd_context_render(struct pipe_context *pctx) fd_resource(pfb->cbufs[i]->texture)->dirty = false; if (pfb->zsbuf) fd_resource(pfb->zsbuf->texture)->dirty = false; + + /* go through all the used resources and clear their reading flag */ + LIST_FOR_EACH_ENTRY_SAFE(rsc, rsc_tmp, &ctx->used_resources, list) { + assert(rsc->reading); + rsc->reading = false; + list_delinit(&rsc->list); + } + + assert(LIST_IS_EMPTY(&ctx->used_resources)); } static void -- cgit v1.2.3