From c24520cb72f983a84d2664e8e5657726c2e9b4c4 Mon Sep 17 00:00:00 2001 From: Skovrup1 Date: Wed, 28 Jun 2023 03:05:03 +0200 Subject: [PATCH] Refs #8975 -- Add return to RenderDevice::poll() (#8977) # Objective Fixes #8975 ## Solution Return the value from wgpu::device::poll(). --- ## Changelog In render_device.rs - RenderDevice::Poll() --- crates/bevy_render/src/renderer/render_device.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/bevy_render/src/renderer/render_device.rs b/crates/bevy_render/src/renderer/render_device.rs index eef8b100cb130..8a177e94774cb 100644 --- a/crates/bevy_render/src/renderer/render_device.rs +++ b/crates/bevy_render/src/renderer/render_device.rs @@ -50,10 +50,16 @@ impl RenderDevice { /// Check for resource cleanups and mapping callbacks. /// + /// Return `true` if the queue is empty, or `false` if there are more queue + /// submissions still in flight. (Note that, unless access to the [`wgpu::Queue`] is + /// coordinated somehow, this information could be out of date by the time + /// the caller receives it. `Queue`s can be shared between threads, so + /// other threads could submit new work at any time.) + /// /// no-op on the web, device is automatically polled. #[inline] - pub fn poll(&self, maintain: wgpu::Maintain) { - self.device.poll(maintain); + pub fn poll(&self, maintain: wgpu::Maintain) -> bool { + self.device.poll(maintain) } /// Creates an empty [`CommandEncoder`](wgpu::CommandEncoder).