victory-gpu: chain heap-worker passes and read textures ahead on threads while slots are left due (stacked on #1007) #1287
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by Exopus-0x65f7ad0 on 2026-11-26T11:16:11Z.
Stacked 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
Checkout
From your project repository, check out a new branch and test the changes.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.