From 2a22fc630f6f4546bec1fc247c63c984ac88bc86 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Sun, 17 Nov 2024 00:54:37 -0800 Subject: [PATCH] vk: fix exclusive fullscreen check --- blade-graphics/src/vulkan/mod.rs | 2 +- blade-graphics/src/vulkan/surface.rs | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/blade-graphics/src/vulkan/mod.rs b/blade-graphics/src/vulkan/mod.rs index b792471..400b95a 100644 --- a/blade-graphics/src/vulkan/mod.rs +++ b/blade-graphics/src/vulkan/mod.rs @@ -94,7 +94,7 @@ pub struct Surface { frames: Vec, next_semaphore: vk::Semaphore, swapchain: Swapchain, - _full_screen_exclusive: bool, + full_screen_exclusive: bool, } #[derive(Clone, Copy, Debug, PartialEq)] diff --git a/blade-graphics/src/vulkan/surface.rs b/blade-graphics/src/vulkan/surface.rs index c94f03c..ae2d7cc 100644 --- a/blade-graphics/src/vulkan/surface.rs +++ b/blade-graphics/src/vulkan/surface.rs @@ -129,7 +129,7 @@ impl super::Context { alpha: crate::AlphaMode::Ignored, target_size: [0; 2], }, - _full_screen_exclusive: fullscreen_exclusive_ext.full_screen_exclusive_supported != 0, + full_screen_exclusive: fullscreen_exclusive_ext.full_screen_exclusive_supported != 0, }) } @@ -327,10 +327,13 @@ impl super::Context { } .queue_family_indices(&queue_families); - if self.device.full_screen_exclusive.is_some() { + if surface.full_screen_exclusive { + assert!(self.device.full_screen_exclusive.is_some()); create_info = create_info.push_next(&mut full_screen_exclusive_info); - } else if !config.allow_exclusive_full_screen { - log::info!("Unable to forbid exclusive full screen"); + log::info!( + "Configuring exclusive full screen: {}", + config.allow_exclusive_full_screen + ); } let raw_swapchain = unsafe { surface.device.create_swapchain(&create_info, None).unwrap() };