gfx-rs/wgpu · error
Tried to set display timing properties without the correspon
Error message
Tried to set display timing properties without the corresponding feature ({:?}) enabled. What it means
`Swapchain::set_next_present_time` schedules a present-time via VK_GOOGLE_display_timing, which requires the `Features::VULKAN_GOOGLE_DISPLAY_TIMING` feature. If the device was not created with it, this public method panics with the feature name. It exists because hal does not have access to wgpu-core's required_features record for a nicer validation error.
Source
Thrown at wgpu-hal/src/vulkan/swapchain/native.rs:691
}
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}
}
impl NativeSwapchain {
pub(crate) fn as_raw(&self) -> vk::SwapchainKHR {
self.raw
}
pub fn set_next_present_time(&mut self, present_timing: vk::PresentTimeGOOGLE) {
let features = wgt::Features::VULKAN_GOOGLE_DISPLAY_TIMING;
if self.device.features.contains(features) {
self.next_present_time = Some(present_timing);
} else {
// Ideally we'd use something like `device.required_features` here, but that's in `wgpu-core`, which we are a dependency of
panic!(
concat!(
"Tried to set display timing properties ",
"without the corresponding feature ({:?}) enabled."
),
features
);
}
}
/// # Safety
///
/// See [`Surface::set_next_present_chain()`](crate::vulkan::Surface::set_next_present_chain).
pub unsafe fn set_next_present_chain(&mut self, chain: *mut core::ffi::c_void) {
self.next_present_chain = Some(PnextChain::new(chain));
}
/// Mark the current frame finished, advancing to the next acquire semaphore.
fn advance_acquire_semaphore(&mut self) {View on GitHub (pinned to 3e11ff59bf)
Solutions
- Add `wgpu::Features::VULKAN_GOOGLE_DISPLAY_TIMING` to required_features when creating the device.
- Check `adapter.features().contains(Features::VULKAN_GOOGLE_DISPLAY_TIMING)` first and skip present-timing scheduling if unsupported.
- Only call set_next_present_time behind a runtime feature check.
Example fix
// before
swapchain.set_next_present_time(present_time);
// after
if device.features().contains(wgpu::Features::VULKAN_GOOGLE_DISPLAY_TIMING) {
swapchain.set_next_present_time(present_time);
} Defensive patterns
Strategy: validation
Validate before calling
if !device.features().contains(wgpu::Features::VULKAN_GOOGLE_DISPLAY_TIMING) {
return; // skip present-timing scheduling
}
swapchain.set_next_present_time(present_time); Prevention
- Gate all display-timing calls behind a runtime feature check.
- Request VULKAN_GOOGLE_DISPLAY_TIMING in required_features only after the adapter reports it.
- Provide a non-timing fallback present path for unsupported drivers.
When it happens
Trigger: Calling `set_next_present_time` on a swapchain whose device was created without `wgpu::Features::VULKAN_GOOGLE_DISPLAY_TIMING`.
Common situations: Frame-pacing / display-timing code copied from a project that enabled the feature; forgetting to declare the extension-backed feature at device creation; running on a platform where the driver lacks VK_GOOGLE_display_timing.
Related errors
- Buffers are required to build acceleration structures
- This vulkan device is affected by [#8333](https://github.com
- vkFreeDescriptorSets error: {err}, please report this error
- {}
- Unexpected Vulkan error: {_err:?}
AI-assisted analysis of gfx-rs/wgpu@3e11ff59bf (2026-09-03).
Data as JSON: /api/errors/18c6dc3a20a6d7bf.
Report an issue: GitHub.