diff options
author | Rob Clark <[email protected]> | 2016-07-14 10:32:02 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-07-30 09:23:42 -0400 |
commit | c44163876a2858aea219a08bd2e048b76953cff9 (patch) | |
tree | 02e83e5140db04c4aa25c290deb808dae94f420a /src/gallium/drivers/freedreno/freedreno_resource.c | |
parent | 7f8fd02dc7cad1ddcfb610db10ffbb41e3e34e7d (diff) |
freedreno: track batch/blit types
Add a bit of extra book-keeping about blits and back-blits (from
resource shadowing). If the app uploads all mipmap levels, as opposed
to uploading the first level and then glGenerateMipmap(), we can discard
the back-blit (as opposed to being naive and shadowing the resource for
each mipmap level). Also, after a normal blit, we might as well flush
the batch immediately, since there is not likely to be further rendering
to the surface.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_resource.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_resource.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index b6c9488ec65..0e0305885a7 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -487,6 +487,12 @@ fd_resource_transfer_map(struct pipe_context *pctx, * to wait. */ } else if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) { + if ((usage & PIPE_TRANSFER_WRITE) && rsc->write_batch && + rsc->write_batch->back_blit) { + /* if only thing pending is a back-blit, we can discard it: */ + fd_batch_reset(rsc->write_batch); + } + /* If the GPU is writing to the resource, or if it is reading from the * resource and we're trying to write to it, flush the renders. */ @@ -1057,7 +1063,7 @@ fd_blitter_pipe_begin(struct fd_context *ctx, bool render_cond, bool discard) if (ctx->batch) fd_hw_query_set_stage(ctx->batch, ctx->batch->draw, FD_STAGE_BLIT); - ctx->discard = discard; + ctx->in_blit = discard; } static void @@ -1065,6 +1071,7 @@ fd_blitter_pipe_end(struct fd_context *ctx) { if (ctx->batch) fd_hw_query_set_stage(ctx->batch, ctx->batch->draw, FD_STAGE_NULL); + ctx->in_blit = false; } static void |