1
0
Fork 0
forked from wry/wry

all: use run-on-drop crate

This commit is contained in:
Julian Orth 2026-02-13 11:09:07 +01:00
parent 346c6a7345
commit 0932ad11b5
19 changed files with 60 additions and 110 deletions

View file

@ -7,13 +7,13 @@ use {
image::{QueueFamily, QueueState, VulkanImage, VulkanImageMemory},
renderer::VulkanRenderer,
},
utils::on_drop::OnDrop,
},
ash::vk::{
Extent3D, ImageAspectFlags, ImageCreateInfo, ImageLayout, ImageSubresourceRange,
ImageTiling, ImageType, ImageViewCreateInfo, ImageViewType, SampleCountFlags, SharingMode,
},
gpu_alloc::UsageFlags,
run_on_drop::on_drop,
std::{cell::Cell, collections::hash_map::Entry, rc::Rc},
};
@ -60,7 +60,7 @@ impl VulkanRenderer {
.usage(usage);
let image = unsafe { self.device.device.create_image(&create_info, None) };
let image = image.map_err(VulkanError::CreateImage)?;
let destroy_image = OnDrop(|| unsafe { self.device.device.destroy_image(image, None) });
let destroy_image = on_drop(|| unsafe { self.device.device.destroy_image(image, None) });
let memory_requirements =
unsafe { self.device.device.get_image_memory_requirements(image) };
let allocation =