A loop limit for compute programs alone (hair strands no longer scatter with VICTORY_SHADER_LOOP_LIMIT=32) #683
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!683
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-683"
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?
@Danigamer05 on GitHub · 2026-11-25 04:24 UTC · original
Danigamer05:fix/compute-loop-limit→main· +58 −12 · 3 files · 1 commits · openProblem
With
VICTORY_SHADER_LOOP_LIMIT=32, which NVIDIA Turing cards run with (#5: without it the device is lost), character hair renders as scattered strands around the head that change every frame.A lane that reaches the translated loop limit leaves the program without its writes (
count_iteration/abort_blockinlower.rs). The hair simulation's per-vertex constraint pass (smh_sim_*:CS_SolvePerVertConstraint, 8 variants) has a uniform loop with one iteration per strand vertex, more than 32 of them. So its lanes never stored, and the strands drawn from the simulation buffers came from stale or never-written positions.How it was narrowed down (RTX 2080 SUPER,
2119b0e):smh_sim_*programs skipped → no scattered strands (posing and interpolation are fine)CS_WavePerSplineConstraint_32skipped → still scatteredCS_SolvePerVertConstraintvariants skipped → scattered strands gone (hair hangs loose, since nothing constrains it)0xa20→0x1b4c,n-1iterations)Change
VICTORY_SHADER_LOOP_LIMIT_CS=<n>(diagnostics builds) sets the loop limit for compute programs only. If it is unset, compute followsVICTORY_SHADER_LOOP_LIMITexactly as before. The shader cache keys on it. The README documents it, and there is a unit test for the parsing (the two limit parsers now share one helper).Measurements (RTX 2080 SUPER,
c96b4f2+ this change, prologue world, 25–30 min each, no device loss in any run)LOOP_LIMIT=32onlyLOOP_LIMIT=32+LOOP_LIMIT_CS=128LOOP_LIMIT=32+LOOP_LIMIT_CS=1024With 1024 a smeared copy of the character also appears along the bottom of the screen: some other compute loop now runs to its end. 128 does not show it, so the README recommends
VICTORY_SHADER_LOOP_LIMIT=32 VICTORY_SHADER_LOOP_LIMIT_CS=128.Not tested on AMD or on cards that run without a loop limit; for them nothing changes unless the new variable is set.
🤖 Generated with Claude Code
@Danigamer05 on GitHub · 2026-11-25 09:12 UTC · original
Rebased onto
mainat9376fd6(it was conflicting after the shader cache key change). The only real change from the old version:compute_loop_limit()now goes intotranslation_fingerprint()next to the loop limit, so cached translations are redone whenVICTORY_SHADER_LOOP_LIMIT_CSchanges. Unit tests and clippy forvictory-shaderpass; the in-game check on9376fd6(RTX 2080 SUPER) is running now.AI-assisted (Claude Code).
@Danigamer05 on GitHub · 2026-11-25 09:16 UTC · original
In-game check on
9376fd6+ this PR, RTX 2080 SUPER,VICTORY_SHADER_LOOP_LIMIT=32 VICTORY_SHADER_LOOP_LIMIT_CS=128, no programs skipped: hair is drawn as whole strands in the first gameplay scene, about 3 fps.AI-assisted (Claude Code).
@Filip722 on GitHub · 2026-11-26 19:30 UTC · original
I tested this compute-only loop limit on Bazzite 44, RTX 5060 Laptop 8 GB, NVIDIA 615.78.08, GE-Proton11-14 and vkd3d-proton 3.2.0. Both Series S runs used the same executable, checkpoint, initial caches and 40% render scale. The general loop limit was 32 in both arms.
Hair scattered around the head with 32. With 128 it held its shape in the same view and throughout a camera turn. Both runs accepted camera input and ended cleanly. These are single-run timing observations. The focused Windows loop-option test passed in the isolated Proton prefix.
Assisted by Codex (GPT-6.2-Sol High).
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.