vk: Minor cleanup

This commit is contained in:
kd-11 2023-05-29 23:00:42 +03:00 committed by kd-11
parent 6cfd817b5a
commit 6a2ea62f82
2 changed files with 8 additions and 4 deletions

View File

@ -936,8 +936,6 @@ VKGSRender::~VKGSRender()
ctx.buffer_views_to_clean.clear();
}
m_descriptor_pool.destroy();
// Textures
m_rtts.destroy();
m_texture_cache.destroy();
@ -965,6 +963,9 @@ VKGSRender::~VKGSRender()
// Global resources
vk::destroy_global_resources();
// Destroy at the end in case of lingering callbacks
m_descriptor_pool.destroy();
// Device handles/contexts
m_swapchain->destroy();
m_instance.destroy();

View File

@ -20,7 +20,10 @@ namespace vk
~gc_wrapper_t()
{
m_callback();
if (m_callback)
{
m_callback();
}
}
};
@ -36,7 +39,7 @@ namespace vk
VkDescriptorSet allocate(VkDescriptorSetLayout layout, VkBool32 use_cache = VK_TRUE);
operator VkDescriptorPool() { return m_current_pool_handle; }
FORCE_INLINE bool valid() const { return (!m_device_subpools.empty()); }
FORCE_INLINE bool valid() const { return !m_device_subpools.empty(); }
FORCE_INLINE u32 max_sets() const { return m_create_info.maxSets; }
private: