diff --git a/frontends/rioterm/src/application.rs b/frontends/rioterm/src/application.rs index 7219034d..07ea326a 100644 --- a/frontends/rioterm/src/application.rs +++ b/frontends/rioterm/src/application.rs @@ -1708,9 +1708,6 @@ impl ApplicationHandler for Application<'_> { } WindowEvent::RedrawRequested => { - // let start = std::time::Instant::now(); - route.window.winit_window.pre_present_notify(); - route.begin_render(); match route.path { diff --git a/sugarloaf/src/context/vulkan.rs b/sugarloaf/src/context/vulkan.rs index 84765467..3d494db8 100644 --- a/sugarloaf/src/context/vulkan.rs +++ b/sugarloaf/src/context/vulkan.rs @@ -368,6 +368,16 @@ impl VulkanContext { /// buffer. Returns `None` if the swapchain needed recreation (caller /// should skip this frame). pub fn acquire_frame(&mut self) -> Option { + // Honor a recreate request observed on the previous tick + // (suboptimal acquire, suboptimal present, or OUT_OF_DATE on + // present). Mirrors wgpu/Metal/wgpu-via-zed practice: keep + // the flag close to the platform-frame entry point so no + // tick draws against a swapchain the compositor has already + // declared stale. + if self.needs_recreate { + self.recreate_swapchain(self.size.width as u32, self.size.height as u32); + } + let slot = self.frame_index; let sync = &self.frames[slot];