vulkan: Rename name mistake to handle

This commit is contained in:
Florian RICHER 2024-11-27 20:48:34 +01:00
parent dd8a5a97ea
commit 001547dbc2
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
5 changed files with 22 additions and 22 deletions

View file

@ -11,7 +11,7 @@ pub struct VkSwapchain {
surface: Arc<VkSurface>,
device: Arc<VkDevice>,
pub(super) swapchain: Option<vk::SwapchainKHR>,
pub(super) handle: Option<vk::SwapchainKHR>,
swapchain_support_details: SwapchainSupportDetails,
pub(super) desired_image_count: u32,
@ -64,7 +64,7 @@ impl VkSwapchain {
surface: surface.clone(),
device: device.clone(),
swapchain: None,
handle: None,
new_requested_surface_resolution: None,
swapchain_support_details,
desired_image_count,
@ -89,7 +89,7 @@ impl VkSwapchain {
let mut swapchain_create_info = self.create_swapchain_info(&self.surface);
if let Some(old_swapchain) = self.swapchain {
if let Some(old_swapchain) = self.handle {
swapchain_create_info.old_swapchain = old_swapchain;
}
@ -114,14 +114,14 @@ impl VkSwapchain {
.collect::<Vec<_>>();
if log::log_enabled!(log::Level::Debug) {
let label = match self.swapchain {
let label = match self.handle {
None => "Swapchain created",
Some(_) => "Swapchain updated",
};
log::debug!("{label} ({swapchain:?}) : {swapchain_create_info:#?}");
}
self.swapchain = Some(swapchain);
self.handle = Some(swapchain);
self.present_image_views = Some(present_images_view);
self.present_images = Some(present_images);
@ -177,7 +177,7 @@ impl VkSwapchain {
pub(super) fn acquire_next_image(&self, semaphore: &VkSemaphore) -> VkResult<(u32, bool)> {
unsafe {
self.device.swapchain_loader.acquire_next_image(
self.swapchain.unwrap(),
self.handle.unwrap(),
u64::MAX,
semaphore.handle,
vk::Fence::null(),
@ -191,7 +191,7 @@ impl VkSwapchain {
fn create_swapchain_info(&self, surface: &VkSurface) -> vk::SwapchainCreateInfoKHR {
vk::SwapchainCreateInfoKHR::default()
.surface(surface.surface)
.surface(surface.handle)
.min_image_count(self.desired_image_count)
.image_color_space(self.surface_format.color_space)
.image_format(self.surface_format.format)
@ -287,13 +287,13 @@ impl VkSwapchain {
impl Drop for VkSwapchain {
fn drop(&mut self) {
if let Some(swapchain) = self.swapchain {
if let Some(swapchain) = self.handle {
unsafe {
self.device
.swapchain_loader
.destroy_swapchain(swapchain, None);
}
self.swapchain = None;
self.handle = None;
log::debug!("Swapchain destroyed ({swapchain:?})");
}
}