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_draw.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_draw.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_draw.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index fd3da1f20e5..dd4a720dd0e 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -84,15 +84,19 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) return; } - if (ctx->discard) { - fd_batch_reset(ctx->batch); - ctx->discard = false; + if (ctx->in_blit) { + fd_batch_reset(batch); + ctx->dirty = ~0; } + batch->blit = ctx->in_blit; + batch->back_blit = ctx->in_shadow; + /* NOTE: needs to be before resource_written(batch->query_buf), otherwise * query_buf may not be created yet. */ fd_hw_query_set_stage(batch, batch->draw, FD_STAGE_DRAW); + /* * Figure out the buffers/features we need: */ @@ -219,9 +223,9 @@ fd_clear(struct pipe_context *pctx, unsigned buffers, if (!fd_render_condition_check(pctx)) return; - if (ctx->discard) { - fd_batch_reset(ctx->batch); - ctx->discard = false; + if (ctx->in_blit) { + fd_batch_reset(batch); + ctx->dirty = ~0; } /* for bookkeeping about which buffers have been cleared (and thus |