use wgt::PollType<u64> in device interface instead of wgt::PollType<SubmissionIndex> (#7562)

This commit is contained in:
sagudev authored and GitHub committed 2025-04-17 18:29:11 -04:00
1 parent 205e464849
commit bbff2c4e0b
6 files changed
+9 -8

No files matched your search

@@ -244,7 +244,10 @@ impl DeviceInterface for CustomDevice {
unimplemented!()
}
fn poll(&self, _maintain: wgpu::PollType) -> Result<wgpu::PollStatus, wgpu::PollError> {
fn poll(
&self,
_maintain: wgpu::wgt::PollType<u64>,
) -> Result<wgpu::PollStatus, wgpu::PollError> {
unimplemented!()
}
+1 -1
View File
@@ -86,7 +86,7 @@ impl Device {
///
/// When running on WebGPU, this is a no-op. `Device`s are automatically polled.
pub fn poll(&self, poll_type: PollType) -> Result<crate::PollStatus, crate::PollError> {
self.inner.poll(poll_type)
self.inner.poll(poll_type.map_index(|s| s.index))
}
/// The features which can be used on this device.
-1
View File
@@ -27,7 +27,6 @@ crate::cmp::impl_eq_ord_hash_proxy!(Queue => .inner);
/// There is no analogue in the WebGPU specification.
#[derive(Debug, Clone)]
pub struct SubmissionIndex {
#[cfg_attr(not(wgpu_core), expect(dead_code))]
pub(crate) index: u64,
}
#[cfg(send_sync)]
+1 -1
View File
@@ -2402,7 +2402,7 @@ impl dispatch::DeviceInterface for WebDevice {
// No capturing api in webgpu
}
fn poll(&self, _poll_type: crate::PollType) -> Result<crate::PollStatus, crate::PollError> {
fn poll(&self, _poll_type: wgt::PollType<u64>) -> Result<crate::PollStatus, crate::PollError> {
// Device is polled automatically
Ok(crate::PollStatus::QueueEmpty)
}
+2 -3
View File
@@ -1686,9 +1686,8 @@ impl dispatch::DeviceInterface for CoreDevice {
};
}
fn poll(&self, poll_type: crate::PollType) -> Result<crate::PollStatus, crate::PollError> {
let maintain_inner = poll_type.map_index(|i| i.index);
match self.context.0.device_poll(self.id, maintain_inner) {
fn poll(&self, poll_type: wgt::PollType<u64>) -> Result<crate::PollStatus, crate::PollError> {
match self.context.0.device_poll(self.id, poll_type) {
Ok(status) => Ok(status),
Err(err) => {
if let Some(poll_error) = err.to_poll_error() {
+1 -1
View File
@@ -166,7 +166,7 @@ pub trait DeviceInterface: CommonTraits {
unsafe fn start_graphics_debugger_capture(&self);
unsafe fn stop_graphics_debugger_capture(&self);
fn poll(&self, poll_type: crate::PollType) -> Result<crate::PollStatus, crate::PollError>;
fn poll(&self, poll_type: wgt::PollType<u64>) -> Result<crate::PollStatus, crate::PollError>;
fn get_internal_counters(&self) -> crate::InternalCounters;
fn generate_allocator_report(&self) -> Option<crate::AllocatorReport>;