Skip to content
Open
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
2 changes: 1 addition & 1 deletion crates/victory-gpu/src/shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ fn workers() -> &'static Workers {
std::hint::spin_loop();
}
turns = turns.wrapping_add(1);
if turns % 16 == 0 {
if turns.is_multiple_of(16) {
std::thread::yield_now();
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/victory-gpu/src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ impl Staging {
return false;
}
last.hash = Some(hash);
if crate::turbo::is_all_zero(&read) {
if crate::turbo::is_all_zero(read) {
return false;
}
self.detile(read);
Expand Down
4 changes: 2 additions & 2 deletions crates/victory-gpu/src/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3942,8 +3942,8 @@ pub fn title_memory_made_real(at: usize, len: usize) {
if len == 0 {
return;
}
let mut g = guards();
open(&mut g, at, at.saturating_add(len));
let g = guards();
open(&g, at, at.saturating_add(len));
}

/// Registers the handler that takes writes to guarded blocks, once, ahead
Expand Down
5 changes: 2 additions & 3 deletions crates/victory-shader/src/emit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2890,7 +2890,7 @@ mod tests {
let res = crate::resource::track(&p, &native.layout, native.stage, None).unwrap();
let io = crate::io::raise(&p, &native).unwrap();
let st = crate::structure::structure(&p).unwrap();
let l = super::lower::lower(&super::lower::Parts {
super::lower::lower(&super::lower::Parts {
native: &native,
p: &p,
st: &st,
Expand All @@ -2901,8 +2901,7 @@ mod tests {
prims: Vec::new(),
mesh_stride: 0,
})
.unwrap();
l
.unwrap()
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/victory-shader/src/emit/water_tile_slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub(super) fn rewrite(native: &mut NativeProgram) -> bool {
new.extend_from_slice(&before[piece.clone()]);
}
let body = &mut native.code[append.body];
debug_assert!(new.len() <= body.len() && body.len() % 4 == 0);
debug_assert!(new.len() <= body.len() && body.len().is_multiple_of(4));
body[..new.len()].copy_from_slice(&new);
for word in body[new.len()..].chunks_exact_mut(4) {
word.copy_from_slice(&nop);
Expand Down