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

View file

@ -19,9 +19,12 @@ namespace vk
{} {}
~gc_wrapper_t() ~gc_wrapper_t()
{
if (m_callback)
{ {
m_callback(); m_callback();
} }
}
}; };
class descriptor_pool class descriptor_pool
@ -36,7 +39,7 @@ namespace vk
VkDescriptorSet allocate(VkDescriptorSetLayout layout, VkBool32 use_cache = VK_TRUE); VkDescriptorSet allocate(VkDescriptorSetLayout layout, VkBool32 use_cache = VK_TRUE);
operator VkDescriptorPool() { return m_current_pool_handle; } 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; } FORCE_INLINE u32 max_sets() const { return m_create_info.maxSets; }
private: private: