| 1816 | #endif /* _VK_TIMELINE_SEMAPHORE */ |
| 1817 | |
| 1818 | void VulkanBaseApp::cleanupSwapChain() |
| 1819 | { |
| 1820 | if (m_depthImageView != VK_NULL_HANDLE) { |
| 1821 | vkDestroyImageView(m_device, m_depthImageView, nullptr); |
| 1822 | } |
| 1823 | if (m_depthImage != VK_NULL_HANDLE) { |
| 1824 | vkDestroyImage(m_device, m_depthImage, nullptr); |
| 1825 | } |
| 1826 | if (m_depthImageMemory != VK_NULL_HANDLE) { |
| 1827 | vkFreeMemory(m_device, m_depthImageMemory, nullptr); |
| 1828 | } |
| 1829 | |
| 1830 | for (size_t i = 0; i < m_uniformBuffers.size(); i++) { |
| 1831 | vkDestroyBuffer(m_device, m_uniformBuffers[i], nullptr); |
| 1832 | vkFreeMemory(m_device, m_uniformMemory[i], nullptr); |
| 1833 | } |
| 1834 | |
| 1835 | if (m_descriptorPool != VK_NULL_HANDLE) { |
| 1836 | vkDestroyDescriptorPool(m_device, m_descriptorPool, nullptr); |
| 1837 | } |
| 1838 | |
| 1839 | for (size_t i = 0; i < m_swapChainFramebuffers.size(); i++) { |
| 1840 | vkDestroyFramebuffer(m_device, m_swapChainFramebuffers[i], nullptr); |
| 1841 | } |
| 1842 | |
| 1843 | if (m_graphicsPipeline != VK_NULL_HANDLE) { |
| 1844 | vkDestroyPipeline(m_device, m_graphicsPipeline, nullptr); |
| 1845 | } |
| 1846 | |
| 1847 | if (m_pipelineLayout != VK_NULL_HANDLE) { |
| 1848 | vkDestroyPipelineLayout(m_device, m_pipelineLayout, nullptr); |
| 1849 | } |
| 1850 | |
| 1851 | if (m_renderPass != VK_NULL_HANDLE) { |
| 1852 | vkDestroyRenderPass(m_device, m_renderPass, nullptr); |
| 1853 | } |
| 1854 | |
| 1855 | for (size_t i = 0; i < m_swapChainImageViews.size(); i++) { |
| 1856 | vkDestroyImageView(m_device, m_swapChainImageViews[i], nullptr); |
| 1857 | } |
| 1858 | |
| 1859 | if (m_swapChain != VK_NULL_HANDLE) { |
| 1860 | vkDestroySwapchainKHR(m_device, m_swapChain, nullptr); |
| 1861 | } |
| 1862 | } |
| 1863 | |
| 1864 | void VulkanBaseApp::recreateSwapChain() |
| 1865 | { |