Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nical committed Jun 17, 2024
1 parent d6c1ec8 commit 8646abe
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use std::path::PathBuf;
use std::{num::NonZeroU32, ops::Range};

pub mod assertions;
pub mod math;
mod counters;
pub mod math;

pub use counters::*;

Expand Down
6 changes: 5 additions & 1 deletion wgpu/src/backend/webgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2978,7 +2978,11 @@ impl crate::context::Context for ContextWebGpu {
fn device_start_capture(&self, _device: &Self::DeviceId, _device_data: &Self::DeviceData) {}
fn device_stop_capture(&self, _device: &Self::DeviceId, _device_data: &Self::DeviceData) {}

fn device_get_internal_counters(&self, _device: &Self::DeviceId, _device_data: &Self::DeviceData) -> wgt::InternalCounters {
fn device_get_internal_counters(
&self,
_device: &Self::DeviceId,
_device_data: &Self::DeviceData,
) -> wgt::InternalCounters {
Default::default()
}

Expand Down
6 changes: 5 additions & 1 deletion wgpu/src/backend/wgpu_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2370,7 +2370,11 @@ impl crate::Context for ContextWgpuCore {
wgc::gfx_select!(device => self.0.device_stop_capture(*device));
}

fn device_get_internal_counters(&self, device: &Self::DeviceId, _device_data: &Self::DeviceData) -> wgt::InternalCounters {
fn device_get_internal_counters(
&self,
device: &Self::DeviceId,
_device_data: &Self::DeviceData,
) -> wgt::InternalCounters {
wgc::gfx_select!(device => self.0.device_get_internal_counters(*device))
}

Expand Down
18 changes: 15 additions & 3 deletions wgpu/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,11 @@ pub trait Context: Debug + WasmNotSendSync + Sized {
fn device_start_capture(&self, device: &Self::DeviceId, device_data: &Self::DeviceData);
fn device_stop_capture(&self, device: &Self::DeviceId, device_data: &Self::DeviceData);

fn device_get_internal_counters(&self, device: &Self::DeviceId, _device_data: &Self::DeviceData) -> wgt::InternalCounters;
fn device_get_internal_counters(
&self,
device: &Self::DeviceId,
_device_data: &Self::DeviceData,
) -> wgt::InternalCounters;

fn pipeline_cache_get_data(
&self,
Expand Down Expand Up @@ -1607,7 +1611,11 @@ pub(crate) trait DynContext: Debug + WasmNotSendSync {
fn device_start_capture(&self, device: &ObjectId, data: &crate::Data);
fn device_stop_capture(&self, device: &ObjectId, data: &crate::Data);

fn device_get_internal_counters(&self, device: &ObjectId, device_data: &crate::Data) -> wgt::InternalCounters;
fn device_get_internal_counters(
&self,
device: &ObjectId,
device_data: &crate::Data,
) -> wgt::InternalCounters;

fn pipeline_cache_get_data(
&self,
Expand Down Expand Up @@ -3083,7 +3091,11 @@ where
Context::device_stop_capture(self, &device, device_data)
}

fn device_get_internal_counters(&self, device: &ObjectId, device_data: &crate::Data) -> wgt::InternalCounters {
fn device_get_internal_counters(
&self,
device: &ObjectId,
device_data: &crate::Data,
) -> wgt::InternalCounters {
let device = <T::DeviceId>::from(*device);
let device_data = downcast_ref(device_data);
Context::device_get_internal_counters(self, &device, device_data)
Expand Down

0 comments on commit 8646abe

Please sign in to comment.