summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_draw.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_draw.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c
index 08cba777510..a4a19750a42 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.c
+++ b/src/gallium/drivers/freedreno/freedreno_draw.c
@@ -384,17 +384,22 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
/* if per-gen backend doesn't implement ctx->clear() generic
* blitter clear:
*/
- if (!ctx->clear) {
- fd_blitter_clear(pctx, buffers, color, depth, stencil);
- return;
- }
+ bool fallback = true;
- fd_batch_set_stage(batch, FD_STAGE_CLEAR);
+ if (ctx->clear) {
+ fd_batch_set_stage(batch, FD_STAGE_CLEAR);
- ctx->clear(ctx, buffers, color, depth, stencil);
+ if (ctx->clear(ctx, buffers, color, depth, stencil)) {
+ if (fd_mesa_debug & FD_DBG_DCLEAR)
+ fd_context_all_dirty(ctx);
- if (fd_mesa_debug & FD_DBG_DCLEAR)
- fd_context_all_dirty(ctx);
+ fallback = false;
+ }
+ }
+
+ if (fallback) {
+ fd_blitter_clear(pctx, buffers, color, depth, stencil);
+ }
}
static void