nak,nil: style cleanup

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
This commit is contained in:
Seán de Búrca 2025-04-03 18:42:53 -07:00 committed by Marge Bot
parent adecea4af9
commit f4f4b25d25
5 changed files with 10 additions and 13 deletions

View file

@ -325,7 +325,7 @@ impl ShaderBin {
},
_ => unsafe { std::mem::zeroed() },
},
hdr: sph::encode_header(sm, &info, fs_key),
hdr: sph::encode_header(sm, info, fs_key),
};
if DEBUG.print() {

View file

@ -2324,7 +2324,7 @@ impl<'a> ShaderFromNir<'a> {
in_bounds: Dst::None,
src: self.get_src(&srcs[0]),
lane: 1_u32.into(),
c: (0x3_u32 | 0x1c_u32 << 8).into(),
c: (0x3_u32 | (0x1c_u32 << 8)).into(),
op: ShflOp::Bfly,
});
@ -2375,7 +2375,7 @@ impl<'a> ShaderFromNir<'a> {
in_bounds: Dst::None,
src: self.get_src(&srcs[0]),
lane: 2_u32.into(),
c: (0x3_u32 | 0x1c_u32 << 8).into(),
c: (0x3_u32 | (0x1c_u32 << 8)).into(),
op: ShflOp::Bfly,
});
@ -3458,7 +3458,7 @@ impl<'a> ShaderFromNir<'a> {
let c = dw * 4 + b;
if c < load_const.def.num_components {
let imm_u8 = unsafe { values[usize::from(c)].u8_ };
imm_u32 |= u32::from(imm_u8) << b * 8;
imm_u32 |= u32::from(imm_u8) << (b * 8);
}
}
dst.push(b.copy(imm_u32.into()));
@ -3472,7 +3472,7 @@ impl<'a> ShaderFromNir<'a> {
if c < load_const.def.num_components {
let imm_u16 =
unsafe { values[usize::from(c)].u16_ };
imm_u32 |= u32::from(imm_u16) << w * 16;
imm_u32 |= u32::from(imm_u16) << (w * 16);
}
}
dst.push(b.copy(imm_u32.into()));

View file

@ -31,10 +31,7 @@ impl<T: Clone> RegUse<T> {
}
}
fn generate_dep_graph(
sm: &dyn ShaderModel,
instrs: &Vec<Box<Instr>>,
) -> DepGraph {
fn generate_dep_graph(sm: &dyn ShaderModel, instrs: &[Box<Instr>]) -> DepGraph {
let mut g = DepGraph::new((0..instrs.len()).map(|_| Default::default()));
// Maps registers to RegUse<ip, src_dst_idx>. Predicates are

View file

@ -90,7 +90,7 @@ impl MthdHeader {
}
fn subc(&self) -> u8 {
(self.0 >> 13 & 0x7) as u8
((self.0 >> 13) & 0x7) as u8
}
fn addr(&self) -> u16 {
@ -99,7 +99,7 @@ impl MthdHeader {
fn len(&self) -> u16 {
debug_assert!(!matches!(self.mthd_type(), MthdType::Immd));
(self.0 >> 16 & 0x1fff) as u16
((self.0 >> 16) & 0x1fff) as u16
}
fn set_len(&mut self, len: u16) {

View file

@ -434,8 +434,8 @@ impl Image {
assert!(bl_mod.pte_kind() == image.pte_kind);
}
image.tile_mode = u16::from(image.levels[0].tiling.y_log2) << 4
| u16::from(image.levels[0].tiling.z_log2) << 8;
image.tile_mode = (u16::from(image.levels[0].tiling.y_log2) << 4)
| (u16::from(image.levels[0].tiling.z_log2) << 8);
image.align_B = std::cmp::max(image.align_B, 4096);
if image.pte_kind >= 0xb && image.pte_kind <= 0xe {