mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Fix warnings for unrecognized Vulkan present mode (#7850)
This commit is contained in:
parent
995efddc62
commit
12808193fe
@ -89,6 +89,7 @@ Bottom level categories:
|
|||||||
#### Vulkan
|
#### Vulkan
|
||||||
|
|
||||||
- Fix OpenBSD compilation of `wgpu_hal::vulkan::drm`. By @ErichDonGubler in [#7810](https://github.com/gfx-rs/wgpu/pull/7810).
|
- Fix OpenBSD compilation of `wgpu_hal::vulkan::drm`. By @ErichDonGubler in [#7810](https://github.com/gfx-rs/wgpu/pull/7810).
|
||||||
|
- Fix warnings for unrecognized present mode. By @Wumpf in [#7850](https://github.com/gfx-rs/wgpu/pull/7850).
|
||||||
|
|
||||||
#### Metal
|
#### Metal
|
||||||
|
|
||||||
|
|||||||
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -5011,7 +5011,6 @@ dependencies = [
|
|||||||
"naga",
|
"naga",
|
||||||
"ndk-sys 0.6.0+11769913",
|
"ndk-sys 0.6.0+11769913",
|
||||||
"objc",
|
"objc",
|
||||||
"once_cell",
|
|
||||||
"ordered-float 5.0.0",
|
"ordered-float 5.0.0",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"portable-atomic",
|
"portable-atomic",
|
||||||
|
|||||||
@ -468,17 +468,25 @@ pub fn map_present_mode(mode: wgt::PresentMode) -> vk::PresentModeKHR {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn map_vk_present_mode(mode: vk::PresentModeKHR) -> Option<wgt::PresentMode> {
|
pub fn map_vk_present_mode(mode: vk::PresentModeKHR) -> Option<wgt::PresentMode> {
|
||||||
if mode == vk::PresentModeKHR::IMMEDIATE {
|
// Not exposed in Ash yet.
|
||||||
Some(wgt::PresentMode::Immediate)
|
const FIFO_LATEST_READY: vk::PresentModeKHR = vk::PresentModeKHR::from_raw(1_000_361_000);
|
||||||
} else if mode == vk::PresentModeKHR::MAILBOX {
|
|
||||||
Some(wgt::PresentMode::Mailbox)
|
// See https://registry.khronos.org/vulkan/specs/latest/man/html/VkPresentModeKHR.html
|
||||||
} else if mode == vk::PresentModeKHR::FIFO {
|
match mode {
|
||||||
Some(wgt::PresentMode::Fifo)
|
vk::PresentModeKHR::IMMEDIATE => Some(wgt::PresentMode::Immediate),
|
||||||
} else if mode == vk::PresentModeKHR::FIFO_RELAXED {
|
vk::PresentModeKHR::MAILBOX => Some(wgt::PresentMode::Mailbox),
|
||||||
Some(wgt::PresentMode::FifoRelaxed)
|
vk::PresentModeKHR::FIFO => Some(wgt::PresentMode::Fifo),
|
||||||
} else {
|
vk::PresentModeKHR::FIFO_RELAXED => Some(wgt::PresentMode::FifoRelaxed),
|
||||||
log::warn!("Unrecognized present mode {:?}", mode);
|
|
||||||
None
|
// Modes that aren't exposed yet.
|
||||||
|
vk::PresentModeKHR::SHARED_DEMAND_REFRESH => None,
|
||||||
|
vk::PresentModeKHR::SHARED_CONTINUOUS_REFRESH => None,
|
||||||
|
FIFO_LATEST_READY => None,
|
||||||
|
|
||||||
|
_ => {
|
||||||
|
log::debug!("Unrecognized present mode {:?}", mode);
|
||||||
|
None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user