Mesa (master): zink: always reset batch states when finding a new one

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 23 15:47:05 UTC 2021


Module: Mesa
Branch: master
Commit: a8d925f52eee2c0545470e639c21886801be99fb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a8d925f52eee2c0545470e639c21886801be99fb

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Sun Mar 21 10:45:48 2021 -0400

zink: always reset batch states when finding a new one

this is a bit safer

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9753>

---

 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++) {



More information about the mesa-commit mailing list