[frame_stats] Use wgpu::PresentMode::AutoVsync/AutoNoVsync for VSync mode

The Auto* modes should have wider compatibility as they implement
fallback behavior based on what the platform supports. This also means
that on web "vsync off" will likely be incorrect.
This commit is contained in:
Arman Uguray 2023-03-16 09:28:42 -07:00 committed by Arman Uguray
parent 02a222f435
commit 8bd1bdfaa8
2 changed files with 3 additions and 3 deletions

View file

@ -158,9 +158,9 @@ fn run(
render_cx.set_present_mode(
&mut render_state.surface,
if vsync_on {
wgpu::PresentMode::Fifo
wgpu::PresentMode::AutoVsync
} else {
wgpu::PresentMode::Immediate
wgpu::PresentMode::AutoNoVsync
},
);
}

View file

@ -70,7 +70,7 @@ impl RenderContext {
format,
width,
height,
present_mode: wgpu::PresentMode::Fifo,
present_mode: wgpu::PresentMode::AutoVsync,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
view_formats: vec![],
};