mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
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) {
|
func (p *descPool) bindDescriptorSet(b *Backend, cmdBuf vk.CommandBuffer, bindPoint vk.PipelineBindPoint, texBinds [texUnits]*Texture, bufBinds [storageUnits]*Buffer) {
|
||||||
realloced := false
|
realloced := false
|
||||||
destroyPool := func() {
|
destroyPool := func() {
|
||||||
pool := p.pool
|
if pool := p.pool; pool != 0 {
|
||||||
b.deferFunc(func(d vk.Device) {
|
b.deferFunc(func(d vk.Device) {
|
||||||
vk.DestroyDescriptorPool(d, pool)
|
vk.DestroyDescriptorPool(d, pool)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
p.pool = 0
|
p.pool = 0
|
||||||
p.cap = 0
|
p.cap = 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user