gpu/internal/vulkan: don't destroy nil vkDescriptorPool

Most drivers seem to tolerate vkDestroyDescriptorPool with a nil
pool, but NVIDIA's (rightly) doesn't. Fix that.

References: https://todo.sr.ht/~eliasnaur/gio/323
References: https://todo.sr.ht/~eliasnaur/gio/314
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-12-19 14:15:22 +01:00
parent a34e239c04
commit 533f85cf8e
+5 -4
View File
@@ -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
}