Skip to content

Commit bbff2c4

Browse files
authored
use wgt::PollType<u64> in device interface instead of wgt::PollType<SubmissionIndex> (gfx-rs#7562)
1 parent 205e464 commit bbff2c4

6 files changed

Lines changed: 9 additions & 8 deletions

File tree

examples/standalone/custom_backend/src/custom.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,10 @@ impl DeviceInterface for CustomDevice {
244244
unimplemented!()
245245
}
246246

247-
fn poll(&self, _maintain: wgpu::PollType) -> Result<wgpu::PollStatus, wgpu::PollError> {
247+
fn poll(
248+
&self,
249+
_maintain: wgpu::wgt::PollType<u64>,
250+
) -> Result<wgpu::PollStatus, wgpu::PollError> {
248251
unimplemented!()
249252
}
250253

wgpu/src/api/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl Device {
8686
///
8787
/// When running on WebGPU, this is a no-op. `Device`s are automatically polled.
8888
pub fn poll(&self, poll_type: PollType) -> Result<crate::PollStatus, crate::PollError> {
89-
self.inner.poll(poll_type)
89+
self.inner.poll(poll_type.map_index(|s| s.index))
9090
}
9191

9292
/// The features which can be used on this device.

wgpu/src/api/queue.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ crate::cmp::impl_eq_ord_hash_proxy!(Queue => .inner);
2727
/// There is no analogue in the WebGPU specification.
2828
#[derive(Debug, Clone)]
2929
pub struct SubmissionIndex {
30-
#[cfg_attr(not(wgpu_core), expect(dead_code))]
3130
pub(crate) index: u64,
3231
}
3332
#[cfg(send_sync)]

wgpu/src/backend/webgpu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2402,7 +2402,7 @@ impl dispatch::DeviceInterface for WebDevice {
24022402
// No capturing api in webgpu
24032403
}
24042404

2405-
fn poll(&self, _poll_type: crate::PollType) -> Result<crate::PollStatus, crate::PollError> {
2405+
fn poll(&self, _poll_type: wgt::PollType<u64>) -> Result<crate::PollStatus, crate::PollError> {
24062406
// Device is polled automatically
24072407
Ok(crate::PollStatus::QueueEmpty)
24082408
}

wgpu/src/backend/wgpu_core.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,9 +1686,8 @@ impl dispatch::DeviceInterface for CoreDevice {
16861686
};
16871687
}
16881688

1689-
fn poll(&self, poll_type: crate::PollType) -> Result<crate::PollStatus, crate::PollError> {
1690-
let maintain_inner = poll_type.map_index(|i| i.index);
1691-
match self.context.0.device_poll(self.id, maintain_inner) {
1689+
fn poll(&self, poll_type: wgt::PollType<u64>) -> Result<crate::PollStatus, crate::PollError> {
1690+
match self.context.0.device_poll(self.id, poll_type) {
16921691
Ok(status) => Ok(status),
16931692
Err(err) => {
16941693
if let Some(poll_error) = err.to_poll_error() {

wgpu/src/dispatch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub trait DeviceInterface: CommonTraits {
166166
unsafe fn start_graphics_debugger_capture(&self);
167167
unsafe fn stop_graphics_debugger_capture(&self);
168168

169-
fn poll(&self, poll_type: crate::PollType) -> Result<crate::PollStatus, crate::PollError>;
169+
fn poll(&self, poll_type: wgt::PollType<u64>) -> Result<crate::PollStatus, crate::PollError>;
170170

171171
fn get_internal_counters(&self) -> crate::InternalCounters;
172172
fn generate_allocator_report(&self) -> Option<crate::AllocatorReport>;

0 commit comments

Comments
 (0)