diff options
author | Rob Clark <[email protected]> | 2016-06-27 09:44:15 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-07-30 09:23:42 -0400 |
commit | 9f219c7047b51561f6f69274d445e6a6ec41c5f8 (patch) | |
tree | 9222818fd1f2d961640e0ae1752659ee58926268 /src/gallium/drivers/freedreno/freedreno_state.c | |
parent | f02a64dbdd2ec147167ad60357bd46d8d964290a (diff) |
freedreno: add batch-cache and batch reordering
Note that I originally also had a entry-point that would construct a key
and do lookup from a pipe_surface. I ended up not needing that (yet?)
but it is easy-enough to re-introduce later if we need it for the blit
path.
For now, not enabled by default, but can be enabled (on a3xx/a4xx) with
FD_MESA_DEBUG=reorder.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_state.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_state.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_state.c b/src/gallium/drivers/freedreno/freedreno_state.c index 98b56c7d512..8ac41d29077 100644 --- a/src/gallium/drivers/freedreno/freedreno_state.c +++ b/src/gallium/drivers/freedreno/freedreno_state.c @@ -117,10 +117,17 @@ fd_set_framebuffer_state(struct pipe_context *pctx, struct fd_context *ctx = fd_context(pctx); struct pipe_framebuffer_state *cso; - DBG("%d: cbufs[0]=%p, zsbuf=%p", ctx->batch->needs_flush, - framebuffer->cbufs[0], framebuffer->zsbuf); - - fd_context_render(pctx); + if (ctx->screen->reorder) { + struct fd_batch *batch = + fd_batch_from_fb(&ctx->screen->batch_cache, ctx, framebuffer); + fd_batch_reference(&ctx->batch, NULL); + ctx->batch = batch; + ctx->dirty = ~0; + } else { + DBG("%d: cbufs[0]=%p, zsbuf=%p", ctx->batch->needs_flush, + framebuffer->cbufs[0], framebuffer->zsbuf); + fd_batch_flush(ctx->batch); + } cso = &ctx->batch->framebuffer; |