From 7a7191c17d3569de2ca8d6573132be8c6983d9b2 Mon Sep 17 00:00:00 2001 From: Krishna Ayyalasomayajula Date: Sat, 30 May 2026 17:55:14 -0500 Subject: [PATCH] fix: use PollType::Wait and remove pre_present_notify (subtask 2.4 fixes) --- docs/01-rainbow-triangle.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/01-rainbow-triangle.md b/docs/01-rainbow-triangle.md index 789e024..9923071 100644 --- a/docs/01-rainbow-triangle.md +++ b/docs/01-rainbow-triangle.md @@ -955,7 +955,7 @@ fn render(&mut self) { wgpu::SurfaceStatus::Success(surface_texture) | wgpu::SurfaceStatus::Suboptimal(surface_texture) => { // Drive GPU work: shader compilation, memory allocation, fence signaling - if let Err(e) = self.device.poll(wgpu::Maintain::Wait) { + if let Err(e) = self.device.poll(wgpu::PollType::Wait { submission_index: None, timeout: None }) { log::error!("Device poll failed: {e}"); return; } @@ -1038,7 +1038,7 @@ from the [swapchain](concepts/GLOSSARY.md#swapchain). The swapchain cycles throu 2–3 pre-allocated back buffers. This call returns immediately if a buffer is available; it does not block on the GPU. -**`device.poll(wgpu::Maintain::Wait)`** — **Synchronous** call that drives +**`device.poll(wgpu::PollType::Wait { submission_index: None, timeout: None })`** — **Synchronous** call that drives in-flight GPU work to completion: shader compilation fences, memory allocation, and queue signaling. Without this, resources accumulate because the device does not reclaim finished work. Called once per frame. Returns @@ -1182,10 +1182,6 @@ buffer from "render target" to "front buffer" on the next vsync. Check logs for the description. This is a programming error, not a runtime condition. -Note: `pre_present_notify()` does **not** exist in wgpu 29. Do not call it. The -device polling via `device.poll()` is the only frame synchronization mechanism -you need. - ## S8: Handling Window Resize WHY `surface.configure()` on resize: The swapchain allocates back buffers at a