From 90af8111c887b41be54d7abdec8cde66ea93dff7 Mon Sep 17 00:00:00 2001 From: Skovrup1 Date: Tue, 27 Jun 2023 23:32:48 +0200 Subject: [PATCH 1/3] add return value to RenderDevice::poll() --- crates/bevy_render/src/renderer/render_device.rs | 4 ++-- 1 file changed, 2 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..849f25a33bf39 100644 --- a/crates/bevy_render/src/renderer/render_device.rs +++ b/crates/bevy_render/src/renderer/render_device.rs @@ -52,8 +52,8 @@ impl RenderDevice { /// /// 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). From e72f83409b4c934eadc1d730f3bf5fd63c57b5ab Mon Sep 17 00:00:00 2001 From: Skovrup1 Date: Wed, 28 Jun 2023 00:09:55 +0200 Subject: [PATCH 2/3] Comment detailing the return value --- crates/bevy_render/src/renderer/render_device.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/bevy_render/src/renderer/render_device.rs b/crates/bevy_render/src/renderer/render_device.rs index 849f25a33bf39..a11f0ddba9733 100644 --- a/crates/bevy_render/src/renderer/render_device.rs +++ b/crates/bevy_render/src/renderer/render_device.rs @@ -50,6 +50,12 @@ 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 [`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) -> bool { From 06136c2c16ec7e06f57cea3295eafaf0465fb281 Mon Sep 17 00:00:00 2001 From: Skovrup1 Date: Wed, 28 Jun 2023 00:25:55 +0200 Subject: [PATCH 3/3] Incorrect reference to Queue in comment on return --- crates/bevy_render/src/renderer/render_device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_render/src/renderer/render_device.rs b/crates/bevy_render/src/renderer/render_device.rs index a11f0ddba9733..8a177e94774cb 100644 --- a/crates/bevy_render/src/renderer/render_device.rs +++ b/crates/bevy_render/src/renderer/render_device.rs @@ -51,7 +51,7 @@ 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 [`Queue`] is + /// 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.)