-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
area: performanceHow fast things goHow fast things gohelp requiredWe need community help to make this happen.We need community help to make this happen.platform: macosIssues with integration with macosIssues with integration with macostype: bugSomething isn't workingSomething isn't working
Description
Description
When trying to make a responsive GUI-heavy application, vsync and responsive resizing (present_with_transaction) are important. But, when both are enabled the FPS fluctuates wildly.
Repro steps
- Set present_with_transaction to true
- Set present_mode to
Fifo
Expected vs observed behavior
Screen.Recording.2025-08-15.at.2.52.17.PM.mp4
Extra materials
Article on fixing this issue with Rust and Metal: https://zed.dev/blog/120fps
Code for setting present_with_transaction:
unsafe {
let surface = surface.as_hal::<wgpu::hal::metal::Api>();
if let Some(surface_ref) = surface {
let surface_ptr: *const wgpu::hal::metal::Surface = &*surface_ref;
let surface_mut_ptr: *mut wgpu::hal::metal::Surface = surface_ptr as *mut _;
#[allow(invalid_reference_casting)]
let surface_mut = &mut *surface_mut_ptr;
surface_mut.present_with_transaction = true;
}
}Surface configuration
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
format: surface_format,
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: surface_caps.alpha_modes[0],
view_formats: vec![],
desired_maximum_frame_latency: 2,
};Platform
MacOS 15.6
M1 Max
wgpu 26.0.1
winit 0.30.12
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: performanceHow fast things goHow fast things gohelp requiredWe need community help to make this happen.We need community help to make this happen.platform: macosIssues with integration with macosIssues with integration with macostype: bugSomething isn't workingSomething isn't working