From 273dcf882e0f2ec1e1e4afde2d5a40dd84a13583 Mon Sep 17 00:00:00 2001 From: saripalli shanmukha kiran sagar <167290171+theoxfaber@users.noreply.github.com> Date: Mon, 15 Jun 2026 23:10:32 +0530 Subject: [PATCH] Add comments to framework.rs explaining animation loop and VSync (#9635) Co-authored-by: theoxfaber Co-authored-by: Shanmukh kiran Sagar Co-authored-by: Connor Fitzgerald --- examples/features/src/framework.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/features/src/framework.rs b/examples/features/src/framework.rs index 27b9a0118..75655cc46 100644 --- a/examples/features/src/framework.rs +++ b/examples/features/src/framework.rs @@ -560,6 +560,9 @@ impl ApplicationHandler for App { context.queue.present(frame); } + // Request another redraw to keep the animation loop running. + // Examples that only render once (like hello_triangle) omit + // this call so the event loop can rest between frames. if let Some(window) = &self.window { window.request_redraw(); } @@ -700,6 +703,7 @@ impl From> width: params.width, height: params.height, desired_maximum_frame_latency: 2, + // Fifo corresponds to traditional VSync. It's supported everywhere. present_mode: wgpu::PresentMode::Fifo, alpha_mode: wgpu::CompositeAlphaMode::Auto, view_formats: vec![format],