mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
[core] Simplify self
types in device::resource
.
Change various functions that have no need to create an owning reference to the `Device` to accept `&self` instead of `&Arc<Self>`. Change `ParentDevice::same_device` to accept `&Device` as the point of comparison, not `&Arc<Device>`. Call sites will use Deref conversion, so no callers need to be changed.
This commit is contained in:
parent
504ff3e1a6
commit
9d24406d29
@ -1882,7 +1882,7 @@ impl Device {
|
||||
}
|
||||
|
||||
pub(crate) fn create_buffer_binding<'a>(
|
||||
self: &Arc<Self>,
|
||||
&self,
|
||||
bb: &'a binding_model::ResolvedBufferBinding,
|
||||
binding: u32,
|
||||
decl: &wgt::BindGroupLayoutEntry,
|
||||
@ -2020,7 +2020,7 @@ impl Device {
|
||||
}
|
||||
|
||||
fn create_sampler_binding<'a>(
|
||||
self: &Arc<Self>,
|
||||
&self,
|
||||
used: &mut BindGroupStates,
|
||||
binding: u32,
|
||||
decl: &wgt::BindGroupLayoutEntry,
|
||||
@ -2069,7 +2069,7 @@ impl Device {
|
||||
}
|
||||
|
||||
pub(crate) fn create_texture_binding<'a>(
|
||||
self: &Arc<Self>,
|
||||
&self,
|
||||
binding: u32,
|
||||
decl: &wgt::BindGroupLayoutEntry,
|
||||
view: &'a Arc<TextureView>,
|
||||
@ -2359,7 +2359,7 @@ impl Device {
|
||||
}
|
||||
|
||||
pub(crate) fn texture_use_parameters(
|
||||
self: &Arc<Self>,
|
||||
&self,
|
||||
binding: u32,
|
||||
decl: &wgt::BindGroupLayoutEntry,
|
||||
view: &TextureView,
|
||||
|
@ -106,8 +106,8 @@ pub(crate) trait ParentDevice: Labeled {
|
||||
}
|
||||
}
|
||||
|
||||
fn same_device(&self, device: &Arc<Device>) -> Result<(), DeviceError> {
|
||||
if Arc::ptr_eq(self.device(), device) {
|
||||
fn same_device(&self, device: &Device) -> Result<(), DeviceError> {
|
||||
if std::ptr::eq(&**self.device(), device) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(DeviceError::DeviceMismatch(Box::new(DeviceMismatch {
|
||||
|
Loading…
Reference in New Issue
Block a user