From a8d925f52eee2c0545470e639c21886801be99fb Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Sun, 21 Mar 2021 10:45:48 -0400 Subject: [PATCH] zink: always reset batch states when finding a new one this is a bit safer Reviewed-by: Adam Jackson Part-of: --- src/gallium/drivers/zink/zink_batch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c index 191b98d89ae..bcc4310483c 100644 --- a/src/gallium/drivers/zink/zink_batch.c +++ b/src/gallium/drivers/zink/zink_batch.c @@ -202,10 +202,11 @@ init_batch_state(struct zink_context *ctx, struct zink_batch *batch) if (he) { //there may not be any entries available bs = he->data; _mesa_hash_table_remove(&ctx->batch_states[batch->queue], he); - zink_reset_batch_state(ctx, bs); } } - if (!bs) { + if (bs) + zink_reset_batch_state(ctx, bs); + else { if (!batch->state) { /* this is batch init, so create a few more states for later use */ for (int i = 0; i < 3; i++) {