From c244b7c34991be6d06cac853a50afc3851b2d303 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 10 Mar 2022 18:14:54 +0100 Subject: [PATCH] gpu/internal/vulkan: resize descriptor set pool correctly Before this change, the resized descriptor set pool would never increase, defeating the purpose of re-using pools. References: https://todo.sr.ht/~eliasnaur/gio/375 Signed-off-by: Elias Naur --- gpu/internal/vulkan/vulkan.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpu/internal/vulkan/vulkan.go b/gpu/internal/vulkan/vulkan.go index 7d3791e8..1af8e095 100644 --- a/gpu/internal/vulkan/vulkan.go +++ b/gpu/internal/vulkan/vulkan.go @@ -691,9 +691,9 @@ func (p *descPool) bindDescriptorSet(b *Backend, cmdBuf vk.CommandBuffer, bindPo if realloced { panic("vulkan: vkAllocateDescriptorSet failed on a newly allocated descriptor pool") } + newCap := p.cap * 2 destroyPool() realloced = true - newCap := p.cap * 2 const initialPoolSize = 100 if newCap < initialPoolSize { newCap = initialPoolSize