forked from joejulian/gio
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user