1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Call pre_present_notify before presenting (#8089)

This commit is contained in:
Dimitris Papaioannou
2026-04-12 17:06:12 +03:00
committed by GitHub
parent 86a7f47738
commit 41b64fc6f3
2 changed files with 6 additions and 0 deletions

View File

@@ -722,6 +722,7 @@ impl WgpuWinitRunning<'_> {
&clipped_primitives, &clipped_primitives,
&textures_delta, &textures_delta,
screenshot_commands, screenshot_commands,
window,
); );
for action in viewport.actions_requested.drain(..) { for action in viewport.actions_requested.drain(..) {
@@ -1111,6 +1112,7 @@ fn render_immediate_viewport(
&clipped_primitives, &clipped_primitives,
&textures_delta, &textures_delta,
vec![], vec![],
window,
); );
egui_winit.handle_platform_output(window, platform_output); egui_winit.handle_platform_output(window, platform_output);

View File

@@ -411,6 +411,7 @@ impl Painter {
/// and the captures captured screenshot if it was requested. /// and the captures captured screenshot if it was requested.
/// ///
/// If `capture_data` isn't empty, a screenshot will be captured. /// If `capture_data` isn't empty, a screenshot will be captured.
#[expect(clippy::too_many_arguments)]
pub fn paint_and_update_textures( pub fn paint_and_update_textures(
&mut self, &mut self,
viewport_id: ViewportId, viewport_id: ViewportId,
@@ -419,6 +420,7 @@ impl Painter {
clipped_primitives: &[epaint::ClippedPrimitive], clipped_primitives: &[epaint::ClippedPrimitive],
textures_delta: &epaint::textures::TexturesDelta, textures_delta: &epaint::textures::TexturesDelta,
capture_data: Vec<UserData>, capture_data: Vec<UserData>,
window: &winit::window::Window,
) -> f32 { ) -> f32 {
profiling::function_scope!(); profiling::function_scope!();
@@ -654,6 +656,8 @@ impl Painter {
); );
} }
window.pre_present_notify();
{ {
profiling::scope!("present"); profiling::scope!("present");
// wgpu doesn't document where vsync can happen. Maybe here? // wgpu doesn't document where vsync can happen. Maybe here?