Skip to content

Commit

Permalink
[wgpu] fix as_hal methods (#6179)
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy authored Aug 28, 2024
1 parent 71b41c6 commit aadca17
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions wgpu/src/api/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl Adapter {
// Therefore, unwrap is fine here since only WgpuCoreContext based adapters have the ability to create hal devices.
.unwrap()
.create_device_from_hal(
crate::context::downcast_ref(&self.data),
crate::context::downcast_ref(self.data.as_ref()),
hal_device,
desc,
trace_path,
Expand Down Expand Up @@ -169,7 +169,7 @@ impl Adapter {
{
unsafe {
ctx.adapter_as_hal::<A, F, R>(
crate::context::downcast_ref(&self.data),
crate::context::downcast_ref(self.data.as_ref()),
hal_adapter_callback,
)
}
Expand Down
2 changes: 1 addition & 1 deletion wgpu/src/api/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl Buffer {
{
unsafe {
ctx.buffer_as_hal::<A, F, R>(
crate::context::downcast_ref(&self.data),
crate::context::downcast_ref(self.data.as_ref()),
hal_buffer_callback,
)
}
Expand Down
2 changes: 1 addition & 1 deletion wgpu/src/api/command_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ impl CommandEncoder {
.downcast_ref::<crate::backend::ContextWgpuCore>()
.map(|ctx| unsafe {
ctx.command_encoder_as_hal_mut::<A, F, R>(
crate::context::downcast_ref(&self.data),
crate::context::downcast_ref(self.data.as_ref()),
hal_command_encoder_callback,
)
})
Expand Down
6 changes: 3 additions & 3 deletions wgpu/src/api/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl Device {
.unwrap()
.create_texture_from_hal::<A>(
hal_texture,
crate::context::downcast_ref(&self.data),
crate::context::downcast_ref(self.data.as_ref()),
desc,
)
};
Expand Down Expand Up @@ -328,7 +328,7 @@ impl Device {
.unwrap()
.create_buffer_from_hal::<A>(
hal_buffer,
crate::context::downcast_ref(&self.data),
crate::context::downcast_ref(self.data.as_ref()),
desc,
)
};
Expand Down Expand Up @@ -441,7 +441,7 @@ impl Device {
.downcast_ref::<crate::backend::ContextWgpuCore>()
.map(|ctx| unsafe {
ctx.device_as_hal::<A, F, R>(
crate::context::downcast_ref(&self.data),
crate::context::downcast_ref(self.data.as_ref()),
hal_device_callback,
)
})
Expand Down
2 changes: 1 addition & 1 deletion wgpu/src/api/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl Surface<'_> {
.downcast_ref::<crate::backend::ContextWgpuCore>()
.map(|ctx| unsafe {
ctx.surface_as_hal::<A, F, R>(
crate::context::downcast_ref(&self.surface_data),
crate::context::downcast_ref(self.surface_data.as_ref()),
hal_surface_callback,
)
})
Expand Down
2 changes: 1 addition & 1 deletion wgpu/src/api/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl Texture {
{
unsafe {
ctx.texture_as_hal::<A, F, R>(
crate::context::downcast_ref(&self.data),
crate::context::downcast_ref(self.data.as_ref()),
hal_texture_callback,
)
}
Expand Down
2 changes: 1 addition & 1 deletion wgpu/src/api/texture_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl TextureView {
{
unsafe {
ctx.texture_view_as_hal::<A, F, R>(
crate::context::downcast_ref(&self.data),
crate::context::downcast_ref(self.data.as_ref()),
hal_texture_view_callback,
)
}
Expand Down

0 comments on commit aadca17

Please sign in to comment.