Module: Mesa
Branch: main
Commit: 904261b985f9992adc7b35bc5767261cbf775566
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=904261b985f9992adc7b35bc5767261cbf775566

Author: Mike Blumenkrantz <[email protected]>
Date:   Wed Sep  8 15:25:42 2021 -0400

zink: unset barrier info if resource object no longer has usage after reset

this avoids spurious barriers

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12845>

---

 src/gallium/drivers/zink/zink_batch.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_batch.c 
b/src/gallium/drivers/zink/zink_batch.c
index 10a165b93c2..f60590ca25e 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -36,7 +36,11 @@ zink_reset_batch_state(struct zink_context *ctx, struct 
zink_batch_state *bs)
    /* unref all used resources */
    set_foreach_remove(bs->resources, entry) {
       struct zink_resource_object *obj = (struct zink_resource_object 
*)entry->key;
-      zink_resource_object_usage_unset(obj, bs);
+      if (!zink_resource_object_usage_unset(obj, bs)) {
+         obj->unordered_barrier = false;
+         obj->access = 0;
+         obj->access_stage = 0;
+      }
       util_dynarray_append(&bs->unref_resources, struct zink_resource_object*, 
obj);
    }
 

Reply via email to