freedreno: Don't re-install a flushed batch

The compute path does this save/restore dance with the current batch, so
various things called to emit state can assume ctx->batch is the current
thing.  But during resource tracking, which could have flushed what was
previously the current batch.  Fixes a problem that surfaces in the next
patch when we stop just flushing batches for all the barriers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
This commit is contained in:
Rob Clark 2023-01-07 11:28:20 -08:00 committed by Marge Bot
parent aa9b62cad3
commit 63e889516d

View file

@ -564,6 +564,12 @@ fd_launch_grid(struct pipe_context *pctx,
if (info->indirect)
resource_read(batch, info->indirect);
/* If the saved batch has been flushed during the resource tracking,
* don't re-install it:
*/
if (save_batch && save_batch->flushed)
fd_batch_reference_locked(&save_batch, NULL);
fd_screen_unlock(ctx->screen);
DBG("%p: work_dim=%u, block=%ux%ux%u, grid=%ux%ux%u",