victory-gpu: chain heap-worker passes and read textures ahead on threads while slots are left due (stacked on #1007) #1290
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1290
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1290"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Exopus-0x65f7ad0 on GitHub · 2026-11-26 11:16 UTC · original
Exopus-0x65f7ad0:pr/heap-chain→main· +594 −19 · 12 files · 4 commits · openStacked on #1007 (heap worker). Only the last commit is new.
What
draw.rs:BACKLOG_LEFTrecords whether the last pass over textures picked by index left slots due. That is the case when the pass was handed a full 4096 slots, or stopped early on bytes, time ormake_way.heap_worker.rs: after a pass, if slots are left due and no newer heap is waiting, the worker hands itself the same heap again. Turn this off withVICTORY_HEAP_WORKER_CHAIN=0.host.rs:refresh_textures_aheadreads textures on scoped threads, but only while the queue is behind.VICTORY_REFRESH_WIDE=<n>sets the thread count (default 4, clamped to 1-8);0or1keeps the old single-thread path. When the queue is not behind it stays sequential, so it does not compete with the submitting thread's copies.Why
I profiled the opening cutscene on a 16 GB machine where texture reads page-fault heavily. The heap worker sat idle about half of each frame (112 of 220 ms) waiting for the next kick, while ~20k slots were still due. Those due slots read null or stale views and show up as black or red faces at shot changes.
With both changes, faces stay textured across the shot changes in my runs. Frame time is unchanged, since that machine is memory-bound anyway.
Tests
cargo test -p victory-gpu: 171 passed.🤖 Generated with Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.