Repository navigation
C-1: resolve clippy warnings in leonida-gpu - #20
yadashtpc-boop wants to merge 1 commit into
Conversation
ShinniUwU
left a comment
There was a problem hiding this comment.
Thanks for this. The six changes are correct and keep behaviour the same, but three things are needed before it can go in:
1. Rebase on main. #19 merged after this was opened and there is one conflict, in crates/leonida-gpu/src/resource.rs. Main added texture_kind and title_texture right after placed_filler_twins, and this PR adds a blank line at the same spot. Keep both sides and drop the extra blank line.
2. Three more is_multiple_of spots. They only show up in the diagnostics build (the second CI step, --all-features). The C-1 row missed them because CI on main stops at the first clippy step. They were already there at this PR's base, so this PR did not introduce them.
// draw.rs:3324
if N.fetch_add(1, std::sync::atomic::Ordering::Relaxed).is_multiple_of(256) {
// watch.rs:481
if !N.fetch_add(1, std::sync::atomic::Ordering::Relaxed).is_multiple_of(2048) {
// watch.rs:872
if N.fetch_add(1, std::sync::atomic::Ordering::Relaxed).is_multiple_of(1024) {3. Delete the C-1 row from TODO.md. The list's rule is that the pull request finishing an item removes its row.
What I ran
I merged this head (32aad8a) with main (f552464) in a scratch copy, on the pinned 1.98.1 toolchain, and ran the three CI commands:
| CI step | Result |
|---|---|
cargo clippy --workspace --all-targets --locked -- -D warnings |
passes |
same with --all-features |
fails with the 3 errors above |
cargo test --workspace --locked |
passes (leonida-gpu 185, leonida-shader 215, leonida-hle 100) |
With the three fixes from point 2 applied, the --all-features step passes too.
Notes
- The
#[allow(dead_code)]onplaced_filler_twinsis justified: its only caller iscopystat.rs:810, and that module is compiled only with thediagnosticsfeature. - The allow on
depth_writtenis fine, the field is set but never read. Its comment ties it to upstream4ab20fc, whichTODO.mdlists as not checked, so I would word that comment as a maybe. - Confirmed:
indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fieldspasses on the merged tree. - CI has not run on this PR yet. The run is waiting for a maintainer to approve it.
Fixes C-1 from TODO.md. Resolves all clippy warnings in leonida-gpu:
field, pending upstream VIctory 4ab20fc, see C-2)
by the copystat memory log under the diagnostics feature)
cargo clippy --workspace --all-targets: no warnings.
cargo test --workspace: all crates pass (leonida-gpu 182 passed,
leonida-shader 215 passed, leonida-hle 98 passed).
Note: indirect::tests::warp_budget_saturates_without_wraparound_and_
preserves_draw_fields (listed in C-2 as possibly fixed by upstream
VIctory 4ab20fc) already passes on this tree.