Mesa (main): zink: destroy lazy descriptor pools during batch reset when unused
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jun 16 04:23:43 UTC 2021
Module: Mesa
Branch: main
Commit: 3edb0a0a5310beff1a790f5267b69c7042bc4254
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3edb0a0a5310beff1a790f5267b69c7042bc4254
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
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 <airlied at redhat.com>
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++) {
More information about the mesa-commit
mailing list