freedreno: check batch size after the fallback blitter clear
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 11 Nov 2021 22:29:43 +0000 (17:29 -0500)
committerMarge Bot <emma+marge@anholt.net>
Thu, 11 Nov 2021 23:26:00 +0000 (23:26 +0000)
When force-flushing after every draw, this would otherwise hit a NULL
batch in fd_blitter_clear.

Tested on a4xx.

Suggested-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13761>

src/gallium/drivers/freedreno/freedreno_draw.c

index 1a7b058..ec64adf 100644 (file)
@@ -487,12 +487,13 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
    debug_assert(!batch->flushed);
 
    fd_batch_unlock_submit(batch);
-   fd_batch_check_size(batch);
 
    if (fallback) {
       fd_blitter_clear(pctx, buffers, color, depth, stencil);
    }
 
+   fd_batch_check_size(batch);
+
    fd_batch_reference(&batch, NULL);
 }