Wait queue to become idle before deleting texture

This commit is contained in:
Benau 2022-03-15 12:42:31 +08:00
parent ea275ae798
commit 4b28f5b9af
2 changed files with 2 additions and 0 deletions

View File

@ -284,6 +284,7 @@ namespace GE
VkMemoryPropertyFlags properties, VkBuffer& buffer,
VkDeviceMemory& buffer_memory);
VkPhysicalDevice getPhysicalDevice() const { return m_physical_device; }
void waitIdle() { vkQueueWaitIdle(m_graphics_queue); }
VkCommandBuffer beginSingleTimeCommands();
void endSingleTimeCommands(VkCommandBuffer command_buffer);

View File

@ -61,6 +61,7 @@ GEVulkanTexture::GEVulkanTexture(const std::string& name, unsigned int size,
// ----------------------------------------------------------------------------
GEVulkanTexture::~GEVulkanTexture()
{
getVKDriver()->waitIdle();
clearVulkanData();
} // ~GEVulkanTexture