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

Author: Mike Blumenkrantz <[email protected]>
Date:   Sun May  9 14:14:53 2021 -0400

zink: destroy lazy descriptor pools during batch reset when unused

this should keep resource usage a bit lower

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

---

 src/gallium/drivers/zink/zink_descriptors_lazy.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_descriptors_lazy.c 
b/src/gallium/drivers/zink/zink_descriptors_lazy.c
index 038188eec32..62743f2d415 100644
--- a/src/gallium/drivers/zink/zink_descriptors_lazy.c
+++ b/src/gallium/drivers/zink/zink_descriptors_lazy.c
@@ -517,8 +517,15 @@ zink_batch_descriptor_reset_lazy(struct zink_screen 
*screen, struct zink_batch_s
       return;
    for (unsigned i = 0; i < ZINK_DESCRIPTOR_TYPES; i++) {
       hash_table_foreach(&bdd_lazy(bs)->pools[i], entry) {
+         const struct zink_descriptor_layout_key *key = entry->key;
          struct zink_descriptor_pool *pool = (void*)entry->data;
-         pool->set_idx = 0;
+         if (key->use_count)
+            pool->set_idx = 0;
+         else {
+            vkDestroyDescriptorPool(screen->dev, pool->pool, NULL);
+            ralloc_free(pool);
+            _mesa_hash_table_remove(&bdd_lazy(bs)->pools[i], entry);
+         }
       }
    }
    for (unsigned i = 0; i < 2; i++) {

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to