gpu: reduce redundant hash lookups and collapse branches in descriptor/draw paths #1117

Open
Lkxex wants to merge 2 commits from upstream-pr/1120 into main
Lkxex commented 2026-11-25 20:19:46 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Lkxex on 2026-11-25T20:19:46Z.


Summary

Apply a small set of clippy-suggested cleanups in victory-gpu with no behavior change:

  • fpsbox: use HashMap::entry instead of contains_key + insert (one hash lookup instead of two).
  • pipeline::library: collapse nested if into a single if … && let Err.
  • queue/shadow: use is_multiple_of instead of % == 0.
  • draw: use sort_unstable_by_key instead of sort_unstable_by.
  • resource: allow dead_code on the unused placed_filler_twins diagnostic.

Validation

  • cargo check -p victory-gpu passes.
  • cargo clippy -p victory-gpu is now warning-free.
  • cargo test -p victory-gpu passes (182 passed, 5 ignored); one pre-existing GPU indirect test (warp_budget_saturates_…) is environment/flaky and unrelated to this change.

Limitations

  • No gameplay/GPU hardware verification; changes are mechanical and behavior-preserving.

Assisted By NetherySiloX

<!-- greyfinch-sync:fxceless/victory-fork:issue:6612967073 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1120). Originally posted by [Lkxex](https://github.com/Lkxex) on 2026-11-25T20:19:46Z. --- ## Summary Apply a small set of clippy-suggested cleanups in `victory-gpu` with no behavior change: - `fpsbox`: use `HashMap::entry` instead of `contains_key` + `insert` (one hash lookup instead of two). - `pipeline::library`: collapse nested `if` into a single `if … && let Err`. - `queue`/`shadow`: use `is_multiple_of` instead of `% == 0`. - `draw`: use `sort_unstable_by_key` instead of `sort_unstable_by`. - `resource`: allow `dead_code` on the unused `placed_filler_twins` diagnostic. ## Validation - `cargo check -p victory-gpu` passes. - `cargo clippy -p victory-gpu` is now warning-free. - `cargo test -p victory-gpu` passes (182 passed, 5 ignored); one pre-existing GPU indirect test (`warp_budget_saturates_…`) is environment/flaky and unrelated to this change. ## Limitations - No gameplay/GPU hardware verification; changes are mechanical and behavior-preserving. Assisted By NetherySiloX
Lkxex commented 2026-11-25 21:05:53 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Lkxex on 2026-11-25T20:21:52Z.


Closing: low-value cleanup, not aligned with contribution goals. Will reopen as part of a larger, evidence-backed change.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7173559679 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1120#issuecomment-7173559679). Originally posted by [Lkxex](https://github.com/Lkxex) on 2026-11-25T20:21:52Z. --- Closing: low-value cleanup, not aligned with contribution goals. Will reopen as part of a larger, evidence-backed change.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1120:upstream-pr/1120'
git switch 'upstream-pr/1120'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1120'
git switch 'upstream-pr/1120'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1120'
git switch 'upstream-pr/1120'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1120'
git switch 'main'
git merge --squash 'upstream-pr/1120'
git switch 'main'
git merge --ff-only 'upstream-pr/1120'
git switch 'main'
git merge 'upstream-pr/1120'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1117
No description provided.