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

This commit is contained in:
sagudev 2025-04-18 00:29:11 +02:00 committed by GitHub
parent 205e464849
commit bbff2c4e0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 9 additions and 8 deletions

View File

@ -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!()
}

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.

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)]

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)
}

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() {

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>;