From e6fc5d1e499e7bfd8862f06583aee6323574f957 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Sat, 26 Nov 2022 10:42:23 -0500 Subject: [PATCH] render/vulkan: increase next descriptor pool size This ensures that the pool sizes grow exponentially, making the number of pools needed logarithmic in the number of descriptors, instead of linear. Since the first pool's size is 256, this change only has an effect when the compositor creates a large number of textures. --- render/vulkan/renderer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c index 82d81c00..a9adc1af 100644 --- a/render/vulkan/renderer.c +++ b/render/vulkan/renderer.c @@ -107,7 +107,7 @@ struct wlr_vk_descriptor_pool *vulkan_alloc_texture_ds( return NULL; } - size_t count = renderer->last_pool_size; + size_t count = 2 * renderer->last_pool_size; if (!count) { count = start_descriptor_pool_size; } @@ -134,6 +134,7 @@ struct wlr_vk_descriptor_pool *vulkan_alloc_texture_ds( return NULL; } + renderer->last_pool_size = count; wl_list_insert(&renderer->descriptor_pools, &pool->link); }