Never pass a null into QueueDeleteImageView (got a report of that).

Went through them all to see where this could happen, can't find any
other path than this, though it's strange.
This commit is contained in:
Henrik Rydgård 2021-01-03 12:44:26 +01:00
parent 5730da3d3a
commit 1acbfb1a52

View File

@ -349,17 +349,25 @@ void VulkanRenderManager::DestroyBackbuffers() {
for (uint32_t i = 0; i < swapchainImageCount_; i++) {
vulkan_->Delete().QueueDeleteImageView(swapchainImages_[i].view);
}
vulkan_->Delete().QueueDeleteImageView(depth_.view);
vulkan_->Delete().QueueDeleteImage(depth_.image);
vulkan_->Delete().QueueDeleteDeviceMemory(depth_.mem);
swapchainImages_.clear();
if (depth_.view) {
vulkan_->Delete().QueueDeleteImageView(depth_.view);
}
if (depth_.image) {
vulkan_->Delete().QueueDeleteImage(depth_.image);
}
if (depth_.mem) {
vulkan_->Delete().QueueDeleteDeviceMemory(depth_.mem);
}
depth_ = {};
for (uint32_t i = 0; i < framebuffers_.size(); i++) {
_dbg_assert_(framebuffers_[i] != VK_NULL_HANDLE);
vulkan_->Delete().QueueDeleteFramebuffer(framebuffers_[i]);
}
framebuffers_.clear();
swapchainImages_.clear();
VLOG("Backbuffers Destroyed");
INFO_LOG(G3D, "Backbuffers destroyed");
}
VulkanRenderManager::~VulkanRenderManager() {