~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class vkDestroyImageView(device, attachments.color.view, nullptr); vkDestroyImage(device, attachments.color.image, nullptr); vkFreeMemory(device, attachments.color.memory, nullptr); vkDestroyImageView(device, attachments.depth.view, nullptr); vkDestroyImage(device, attachments.depth.image, nullptr); vkFreeMemory(device, attachments.depth.memory, nullptr); vkDestroyPipeline(device, pipelines.attachmentRead, nullptr); vkDestroyPipeline(device, pipelines.attachmentWrite, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.attachmentWrite, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.attachmentRead, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.attachmentWrite, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.attachmentRead, nullptr); vkDestroyRenderPass(device, uiRenderPass, nullptr); scene.destroy(); uniformBuffers.matrices.destroy(); uniformBuffers.params.destroy(); }
~VulkanExample() { vkDestroyPipeline(device, pipeline, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.scene, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.object, nullptr); model.destroy(); uniformBuffers.scene.destroy(); }