Work towards a clean vulkan shutdown.

This commit is contained in:
Henrik Rydgard committed 2017-05-07 10:40:11 +02:00
1 parent 032e21b707
commit 5974e0ee6d
3 files changed
+30 -6

No files matched your search

+6 -6
View File
@@ -555,7 +555,7 @@ public:
assert(VK_SUCCESS == res);
}
~VKSamplerState() {
vkDestroySampler(vulkan_->GetDevice(), sampler_, nullptr);
vulkan_->Delete().QueueDeleteSampler(sampler_);
}
VkSampler GetSampler() { return sampler_; }
@@ -716,17 +716,17 @@ VKContext::VKContext(VulkanContext *vulkan)
}
VKContext::~VKContext() {
vkDestroyCommandPool(device_, cmdPool_, nullptr);
vulkan_->Delete().QueueDeleteCommandPool(cmdPool_);
// This also destroys all descriptor sets.
for (int i = 0; i < 2; i++) {
frame_[i].descSets_.clear();
vkDestroyDescriptorPool(device_, frame_[i].descriptorPool, nullptr);
vulkan_->Delete().QueueDeleteDescriptorPool(frame_[i].descriptorPool);
frame_[i].pushBuffer->Destroy(vulkan_);
delete frame_[i].pushBuffer;
}
vkDestroyDescriptorSetLayout(device_, descriptorSetLayout_, nullptr);
vkDestroyPipelineLayout(device_, pipelineLayout_, nullptr);
vkDestroyPipelineCache(device_, pipelineCache_, nullptr);
vulkan_->Delete().QueueDeleteDescriptorSetLayout(descriptorSetLayout_);
vulkan_->Delete().QueueDeletePipelineLayout(pipelineLayout_);
vulkan_->Delete().QueueDeletePipelineCache(pipelineCache_);
}
void VKContext::Begin(bool clear, uint32_t colorval, float depthVal, int stencilVal) {