diff --git a/naga/src/back/glsl/mod.rs b/naga/src/back/glsl/mod.rs index d13abb1994..2e719055e8 100644 --- a/naga/src/back/glsl/mod.rs +++ b/naga/src/back/glsl/mod.rs @@ -3497,13 +3497,13 @@ impl<'a, W: Write> Writer<'a, W> { Mf::Transpose => "transpose", Mf::Determinant => "determinant", Mf::QuantizeToF16 => match *ctx.resolve_type(arg, &self.module.types) { - crate::TypeInner::Scalar { .. } => { + TypeInner::Scalar { .. } => { write!(self.out, "unpackHalf2x16(packHalf2x16(vec2(")?; self.write_expr(arg, ctx)?; write!(self.out, "))).x")?; return Ok(()); } - crate::TypeInner::Vector { + TypeInner::Vector { size: crate::VectorSize::Bi, .. } => { @@ -3512,7 +3512,7 @@ impl<'a, W: Write> Writer<'a, W> { write!(self.out, "))")?; return Ok(()); } - crate::TypeInner::Vector { + TypeInner::Vector { size: crate::VectorSize::Tri, .. } => { @@ -3523,7 +3523,7 @@ impl<'a, W: Write> Writer<'a, W> { write!(self.out, ".zz)).x)")?; return Ok(()); } - crate::TypeInner::Vector { + TypeInner::Vector { size: crate::VectorSize::Quad, .. } => { diff --git a/wgpu-core/src/command/ray_tracing.rs b/wgpu-core/src/command/ray_tracing.rs index ac3bbb67b4..08f720c75a 100644 --- a/wgpu-core/src/command/ray_tracing.rs +++ b/wgpu-core/src/command/ray_tracing.rs @@ -689,7 +689,7 @@ impl Global { if let Some(ref staging_buffer) = staging_buffer { cmd_buf_raw.transition_buffers(&[hal::BufferBarrier:: { buffer: staging_buffer.raw(), - usage: hal::BufferUses::MAP_WRITE..hal::BufferUses::COPY_SRC, + usage: BufferUses::MAP_WRITE..BufferUses::COPY_SRC, }]); } } @@ -711,7 +711,7 @@ impl Global { unsafe { cmd_buf_raw.transition_buffers(&[hal::BufferBarrier:: { buffer: tlas.instance_buffer.as_ref(), - usage: hal::BufferUses::MAP_READ..hal::BufferUses::COPY_DST, + usage: BufferUses::MAP_READ..BufferUses::COPY_DST, }]); let temp = hal::BufferCopy { src_offset: range.start as u64, @@ -951,7 +951,7 @@ fn iter_blas<'a>( } let data = cmd_buf_data.trackers.buffers.set_single( &index_buffer, - hal::BufferUses::BOTTOM_LEVEL_ACCELERATION_STRUCTURE_INPUT, + BufferUses::BOTTOM_LEVEL_ACCELERATION_STRUCTURE_INPUT, ); Some((index_buffer.clone(), data)) } else { diff --git a/wgpu-core/src/ray_tracing.rs b/wgpu-core/src/ray_tracing.rs index 11ccb714f1..f6102b552e 100644 --- a/wgpu-core/src/ray_tracing.rs +++ b/wgpu-core/src/ray_tracing.rs @@ -13,7 +13,7 @@ use crate::{ id::{BlasId, BufferId, TlasId}, resource::CreateBufferError, }; -use std::sync::Arc; +use std::{mem::size_of, sync::Arc}; use std::{num::NonZeroU64, slice}; use crate::resource::{Blas, ResourceErrorIdent, Tlas}; @@ -325,11 +325,8 @@ pub(crate) fn tlas_instance_into_bytes( }; let temp: *const _ = &temp; unsafe { - slice::from_raw_parts::( - temp.cast::(), - std::mem::size_of::(), - ) - .to_vec() + slice::from_raw_parts::(temp.cast::(), size_of::()) + .to_vec() } } _ => unimplemented!(), diff --git a/wgpu-core/src/scratch.rs b/wgpu-core/src/scratch.rs index f5930a5e01..dcd2d28fb4 100644 --- a/wgpu-core/src/scratch.rs +++ b/wgpu-core/src/scratch.rs @@ -21,7 +21,7 @@ impl ScratchBuffer { usage: BufferUses::ACCELERATION_STRUCTURE_SCRATCH, memory_flags: hal::MemoryFlags::empty(), }) - .map_err(crate::device::DeviceError::from_hal)? + .map_err(DeviceError::from_hal)? }; Ok(Self { raw: ManuallyDrop::new(raw),