summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_draw.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-07-01 12:38:16 -0400
committerRob Clark <[email protected]>2016-07-30 09:23:42 -0400
commitba3009688892713b711ca6e9420d813f0bdce43f (patch)
treea9acb89c8f3996de84c1808d171fcdd314284e74 /src/gallium/drivers/freedreno/freedreno_draw.c
parent7105774babc4d23623c3547cd19122a55c1090db (diff)
freedreno: support discarding previous rendering in special cases
Basically, to "DCE" blits triggered by resource shadowing, in cases where the levels are immediately completely overwritten. For example, mid-frame texture upload to level zero triggers shadowing and back-blits to the remaining levels, which are immediately overwritten by glGenerateMipmap(). 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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c
index b8ba4545b94..112bf5cb624 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.c
+++ b/src/gallium/drivers/freedreno/freedreno_draw.c
@@ -84,6 +84,11 @@ 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;
+ }
+
/*
* Figure out the buffers/features we need:
*/
@@ -209,6 +214,11 @@ 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;
+ }
+
/* for bookkeeping about which buffers have been cleared (and thus
* can fully or partially skip mem2gmem) we need to ignore buffers
* that have already had a draw, in case apps do silly things like