Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep up with ~~the Jones family~~ retroactively applying Rust 1.82 lints s'more #6542

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions naga/src/back/glsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
..
} => {
Expand All @@ -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,
..
} => {
Expand All @@ -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,
..
} => {
Expand Down
6 changes: 3 additions & 3 deletions wgpu-core/src/command/ray_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ impl Global {
if let Some(ref staging_buffer) = staging_buffer {
cmd_buf_raw.transition_buffers(&[hal::BufferBarrier::<dyn hal::DynBuffer> {
buffer: staging_buffer.raw(),
usage: hal::BufferUses::MAP_WRITE..hal::BufferUses::COPY_SRC,
usage: BufferUses::MAP_WRITE..BufferUses::COPY_SRC,
}]);
}
}
Expand All @@ -711,7 +711,7 @@ impl Global {
unsafe {
cmd_buf_raw.transition_buffers(&[hal::BufferBarrier::<dyn hal::DynBuffer> {
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,
Expand Down Expand Up @@ -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 {
Expand Down
9 changes: 3 additions & 6 deletions wgpu-core/src/ray_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -325,11 +325,8 @@ pub(crate) fn tlas_instance_into_bytes(
};
let temp: *const _ = &temp;
unsafe {
slice::from_raw_parts::<u8>(
temp.cast::<u8>(),
std::mem::size_of::<RawTlasInstance>(),
)
.to_vec()
slice::from_raw_parts::<u8>(temp.cast::<u8>(), size_of::<RawTlasInstance>())
.to_vec()
}
}
_ => unimplemented!(),
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/scratch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down