Skip to content

Commit

Permalink
vk: fix exclusive fullscreen check
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Nov 17, 2024
1 parent 91e55df commit 2a22fc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion blade-graphics/src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub struct Surface {
frames: Vec<InternalFrame>,
next_semaphore: vk::Semaphore,
swapchain: Swapchain,
_full_screen_exclusive: bool,
full_screen_exclusive: bool,
}

#[derive(Clone, Copy, Debug, PartialEq)]
Expand Down
11 changes: 7 additions & 4 deletions blade-graphics/src/vulkan/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}

Expand Down Expand Up @@ -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() };

Expand Down

0 comments on commit 2a22fc6

Please sign in to comment.