fix: use PollType::Wait and remove pre_present_notify (subtask 2.4 fixes)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user