diff options
author | Rob Clark <[email protected]> | 2016-05-20 20:05:26 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-07-30 09:23:42 -0400 |
commit | 9e4561d3c47c2dabce43ce160915fd9bcea05a81 (patch) | |
tree | 6e9157a18a356672f2568831e4139d42fb01f1da /src/gallium/drivers/freedreno/freedreno_draw.c | |
parent | 9bbd239a4039522d7c1023ecb21764679447bb2d (diff) |
freedreno: push resource tracking down into batch
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_draw.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_draw.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index 26164f2109e..2c76333cf12 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -40,38 +40,19 @@ #include "freedreno_util.h" static void -resource_used(struct fd_context *ctx, struct pipe_resource *prsc, - enum fd_resource_status status) +resource_read(struct fd_context *ctx, struct pipe_resource *prsc) { - struct fd_resource *rsc; - if (!prsc) return; - - rsc = fd_resource(prsc); - rsc->status |= status; - if (rsc->stencil) - rsc->stencil->status |= status; - - /* TODO resources can actually be shared across contexts, - * so I'm not sure a single list-head will do the trick? - */ - debug_assert((rsc->pending_ctx == ctx) || !rsc->pending_ctx); - list_delinit(&rsc->list); - list_addtail(&rsc->list, &ctx->used_resources); - rsc->pending_ctx = ctx; -} - -static void -resource_read(struct fd_context *ctx, struct pipe_resource *prsc) -{ - resource_used(ctx, prsc, FD_PENDING_READ); + fd_batch_resource_used(ctx->batch, fd_resource(prsc), FD_PENDING_READ); } static void resource_written(struct fd_context *ctx, struct pipe_resource *prsc) { - resource_used(ctx, prsc, FD_PENDING_WRITE); + if (!prsc) + return; + fd_batch_resource_used(ctx->batch, fd_resource(prsc), FD_PENDING_WRITE); } static void @@ -300,8 +281,6 @@ fd_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *ps, void fd_draw_init(struct pipe_context *pctx) { - list_inithead(&fd_context(pctx)->used_resources); - pctx->draw_vbo = fd_draw_vbo; pctx->clear = fd_clear; pctx->clear_render_target = fd_clear_render_target; |