diff --git a/gpu/internal/vulkan/vulkan.go b/gpu/internal/vulkan/vulkan.go index f69c2322..7d3791e8 100644 --- a/gpu/internal/vulkan/vulkan.go +++ b/gpu/internal/vulkan/vulkan.go @@ -678,10 +678,11 @@ func (p *descPool) release(d vk.Device) { func (p *descPool) bindDescriptorSet(b *Backend, cmdBuf vk.CommandBuffer, bindPoint vk.PipelineBindPoint, texBinds [texUnits]*Texture, bufBinds [storageUnits]*Buffer) { realloced := false destroyPool := func() { - pool := p.pool - b.deferFunc(func(d vk.Device) { - vk.DestroyDescriptorPool(d, pool) - }) + if pool := p.pool; pool != 0 { + b.deferFunc(func(d vk.Device) { + vk.DestroyDescriptorPool(d, pool) + }) + } p.pool = 0 p.cap = 0 }