Skip to content

GPU: opt-in VICTORY_SHADER_TURBO_PAUSE, more compile workers while little is drawn (off by default) - #3648

Open
TG0000 wants to merge 1 commit into
Marvisak:mainfrom
TG0000:pr/shader-turbo-pause
Open

TG0000 wants to merge 1 commit into
Marvisak:mainfrom
TG0000:pr/shader-turbo-pause

Conversation

@TG0000

@TG0000 TG0000 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

What

VICTORY_SHADER_TURBO_PAUSE=1, off by default: more pipeline compile threads while the title draws next to nothing (pause menu, menus, loading), and only then.

Workers
Switch off, or gameplay half the logical processors, 2 to 8 (as on main)
Turbo all logical processors but two, at most 32 (VICTORY_SHADER_TURBO_THREADS=<n> for another count, never below gameplay's)
  • On: after 8 presented frames in a row under 400 draws and dispatches (run or dropped) with pipelines waiting, or when no frame was presented for 1 s with more than 32 waiting.
  • Off: the first frame with 400 or more. Each extra worker finishes the pipeline it holds and parks.
  • The extra threads are started once, at the first switch, run below normal priority like the others, and wait on a condition variable of their own, so a job's notice is not taken by a worker that may not take the job.

Counts, decisions and waiting are in pipeline/turbo.rs (standard library only). With the switch off, the same number of workers take from the same two queues in the same order as before; the code that does so is rearranged.

Limits

  • 400 is a guess. Whether the title's pause menu stays under it has not been checked; the shader compile turbo on / off log lines show it.
  • More compiles at once take more system memory.
  • A driver compile already running when gameplay resumes still takes its processor until it ends.

Tested

  • cargo clippy --workspace --all-targets -- -D warnings, with and without --all-features, for x86_64-pc-windows-msvc (cross-built on macOS): clean.
  • The 8 turbo.rs tests, built alone with rustc --test on macOS: passed.
  • cargo test -p victory-formats -p xtask (asset policy): passed. The existing make.rs tests are Windows-only and left to CI.
  • Not run on a GPU or in the title. No effect on compile time or frame rate is measured, here or on our fork.

Our target machine (not used to test this branch): AMD Radeon RX 6800 16 GB (ReBAR), Adrenalin 26.11.2, Ryzen 9 5900X, Windows 11.

Overlaps

All of these also change the workers in make.rs, so whichever lands second needs a small rebase: #3527 (worker count and priority overrides), #1505 (normal priority; its measurement suggests below-normal threads get little time in the world, where this adds none anyway), #3025 (graphics before compute), #3378 (queue order).

AI-assisted (Claude).

🤖 Generated with Claude Code

…ttle is drawn

Pipeline workers stay at half the logical processors, eight at most. With
the switch on they get company while the title draws next to nothing: after
eight presented frames in a row under 400 draws and dispatches with
pipelines waiting, or a second without a frame with more than 32 waiting,
all logical processors but two compile (at most 32,
VICTORY_SHADER_TURBO_THREADS for another count). The first busier frame
sends the extra workers back: each ends the pipeline it holds and parks.

Off by default. Counts, decisions and the waiting are in pipeline/turbo.rs,
which depends on the standard library only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant