summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_context.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2015-07-31 12:07:24 -0400
committerRob Clark <[email protected]>2015-08-04 16:03:45 -0400
commit5ca032a9a8ece0a8a43151f988215484da3c1811 (patch)
treec1e3875d44447d71555d960c05898264da87a0e2 /src/gallium/drivers/freedreno/freedreno_context.c
parentc7deea51d2b611564c91e146fbd1ed0b547f65c0 (diff)
freedreno: simplify/cleanup resource status tracking
Collapse dirty/reading bools into status bitmask (and drop writing which should really be the same as dirty). And use 'used_resources' list for all tracking, including zsbuf/cbufs, rather than special casing the color and depth/stencil buffers. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_context.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_context.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c
index 02613dcdbdb..8e6d43150ce 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -94,9 +94,7 @@ void
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);
@@ -118,21 +116,11 @@ fd_context_render(struct pipe_context *pctx)
ctx->gmem_reason = 0;
ctx->num_draws = 0;
- for (i = 0; i < pfb->nr_cbufs; i++)
- if (pfb->cbufs[i])
- fd_resource(pfb->cbufs[i]->texture)->dirty = false;
- if (pfb->zsbuf) {
- rsc = fd_resource(pfb->zsbuf->texture);
- rsc->dirty = false;
- if (rsc->stencil)
- rsc->stencil->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->writing);
- rsc->reading = false;
- rsc->writing = false;
+ debug_assert(rsc->status != 0);
+ rsc->status = 0;
+ rsc->pending_ctx = NULL;
list_delinit(&rsc->list);
}