GPU: avoid fully sorting due texture queues #733

Open
user2949 wants to merge 1 commit from upstream-pr/733 into main
user2949 commented 2026-11-25 05:52:01 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by user2949 on 2026-11-25T05:52:01Z.


Why

TextureQueue::due sorts every due slot, though it returns at most 4,096. The code documents backlogs of 25,000–40,000; sorting entries that cannot be served this pass adds CPU work before the upload budget starts.

What changed

Partial selection preserves the existing priority and newest/oldest alternation while sorting only entries returned. A regression test compares the selection with the previous full-sort behavior across a large mixed backlog.

Reported performance

User-reported current test: about 0.5 FPS on an Intel Core i7-14700F, AMD Radeon RX 6600 XT, and 32 GB DDR5 RAM; the game remains unplayable at that speed. This is not a controlled before/after measurement, so it does not establish how much this change affects FPS.

Tested

  • cargo test --workspace --locked -- --test-threads=4 passed on Windows.
  • cargo clippy -p victory-gpu --all-targets --locked passed with existing warnings.
  • Strict -D warnings Clippy remains blocked by existing main-branch warnings.
  • No controlled in-game before/after benchmark.

Assisted by ChatGPT Codex (GPT-6).

<!-- greyfinch-sync:fxceless/victory-fork:issue:6598176588 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/733). Originally posted by [user2949](https://github.com/user2949) on 2026-11-25T05:52:01Z. --- ## Why `TextureQueue::due` sorts every due slot, though it returns at most 4,096. The code documents backlogs of 25,000–40,000; sorting entries that cannot be served this pass adds CPU work before the upload budget starts. ## What changed Partial selection preserves the existing priority and newest/oldest alternation while sorting only entries returned. A regression test compares the selection with the previous full-sort behavior across a large mixed backlog. ## Reported performance User-reported current test: about 0.5 FPS on an Intel Core i7-14700F, AMD Radeon RX 6600 XT, and 32 GB DDR5 RAM; the game remains unplayable at that speed. This is not a controlled before/after measurement, so it does not establish how much this change affects FPS. ## Tested - `cargo test --workspace --locked -- --test-threads=4` passed on Windows. - `cargo clippy -p victory-gpu --all-targets --locked` passed with existing warnings. - Strict `-D warnings` Clippy remains blocked by existing main-branch warnings. - No controlled in-game before/after benchmark. Assisted by ChatGPT Codex (GPT-6).
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/733:upstream-pr/733'
git switch 'upstream-pr/733'

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/733'
git switch 'upstream-pr/733'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/733'
git switch 'upstream-pr/733'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/733'
git switch 'main'
git merge --squash 'upstream-pr/733'
git switch 'main'
git merge --ff-only 'upstream-pr/733'
git switch 'main'
git merge 'upstream-pr/733'
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!733
No description provided.