loader: opt-in RAGE 9 shadow/volumetric/tree/world-distance switches #114
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/ReTerryDavis--ReVIctory!114
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-113"
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?
@SovietBearz0r on GitHub · 2026-12-05 12:47 UTC · original
SovietBearz0r:xmem-detail-switches→main· +7539 −474 · 58 files · 49 commits · draftAdd opt-in RAGE 9 force-value quality switches to the existing
detail.rspatch pass (each off unless set):VICTORY_LOW_SHADOWS,VICTORY_SHADOW_CASCADES,VICTORY_SHADOW_DIST,VICTORY_LOW_VOLUMETRIC,VICTORY_TREE_TESS,VICTORY_ITER_TIER,VICTORY_WORLD_DIST_SCALE.What
Ported from xmem PR #211 into main's
crates/victory-loader/src/detail.rs, byte-checked throughresolution::writeand logged (detail: <what> (<value>) at title+<offset>: <Patched>):LOW_SHADOWS512/768/1024/1280/1536/2048 →GetShadowMapResolutionat+0x1ce8bb0;SHADOW_CASCADES1–3 → store at+0x5705b63;SHADOW_DISTlow/min/1/on → both shadow-distance reads+0x5ad09fd/+0x5ad0a66;LOW_VOLUMETRIC→ 128 px / 7 mips at+0x1c9bea0;TREE_TESS0/off →mov cl,0at+0x22436e9;ITER_TIER0/low → both tier reads at+0x2243767;WORLD_DIST_SCALE0.05–1.0 → scaled LOD table at+0x4fd06cb/+0x7453e24(s=1.0accepted).Three new pure parse/encode tests (every value set, encodings, displacement/NOP padding). Deliberate deviations: numeric shadow values only (xmem's word aliases dropped as ambiguous);
SHADOW_DIST=0/offmeans off per our "off unless set" rule; the PR'sVICTORY_SMALL_CULLwidening and six switches already expressible throughVICTORY_TITLE_QUALITYwere left out.Verification
cargo test -p victory-loader --lib -- --test-threads=1: 140 passed. (Parallel-p victory-loaderruns hang in a pre-existing loader-lock deadlock between two unrelated tests, with or without this change — single-threaded is green.)cargo check -p victory,cargo xtask policy, clippy onvictory-loader(only main's pre-existing telemetry hex warnings): clean.patched(notDiffers) per site; then A/B screenshots/draw counts for each switch. Hard-coded RVAs are byte-checked so a different build is a safe skip;WORLD_DIST_SCALEuses AVX (vshufps); ifVICTORY_TITLE_QUALITYis also set, the force-value site wins for directional shadow quality.Source: lobomfz/VIctory-xmem PR #211 (sites credited there to ToLIManl/VIctory-Hydra and HSgod/ps5-fpsunlocker-gta6).
@ReTerryDavis on GitHub · 2026-12-05 17:38 UTC · original
Marking this as draft for now. This adds 7 raw-RVA opt-in env vars that haven't been verified in-game on 1.0.2.1 yet and heavily overlap existing
VICTORY_TITLE_QUALITY/VICTORY_LOD_SCALEcontrols, plus a few concrete issues:asked_switch:VICTORY_TREE_TESSandVICTORY_ITER_TIERactivate on0/off, so passing=1prints a bogusexpected 0 or offerror to stderr.SUBSYSTEM_ITER_TIER(+0x2243767) zeroes[rsi+0x60], silently colliding withhairQualityintitle_quality.rs.world_dist_scale_code(+0x4fd06cb) mutates and broadcastsxmm0where stock code preserved it — needs verification against 1.0.2.1 disassembly thatxmm0is dead past+0x4fd070c.@SovietBearz0r on GitHub · 2026-12-05 18:52 UTC · original
Fixed the parse/safety issues:
VICTORY_TREE_TESS/VICTORY_ITER_TIERare true toggles now (1/on/true/yesenables;0/off/false/no/unset leaves the title alone; the bogus "expected 0 or off" stderr is gone, truth-table tested).VICTORY_ITER_TIERnow refuses with a clear warning whenVICTORY_TITLE_QUALITYsetshairQuality, because its site reads[rsi+0x60], the same settings member (HAIR_QUALITYpinned by test) — I chose refusal over moving a byte-compared site without disassembly.world_dist_scale_codeno longer writesxmm0: the scale² factor is built inxmm1(which the title clobbers anyway), the table is a memory operand, and bytes are pinned by test. Staying draft: all seven switches still need 1.0.2.1 in-game verification, and whether a different instruction can carry ITER_TIER without touching[rsi+0x60]needs the title disassembly.@TrinityForever15 on GitHub · 2026-12-06 03:16 UTC · original
I ported these switches to a larp-based build and found a bug in
VICTORY_WORLD_DIST_SCALE(world_dist_scale_codeincrates/victory-loader/src/detail.rs). The last multiply isIt is a packed multiply, but the title only passes the input as a scalar in
xmm0[0]. The code being replaced usesvmulss xmm1, xmm1, xmm0for each of the three distances. Lanes 1 and 2 ofxmm0are 0.0 at that point, so LOD1 and LOD2 come out as 0. With the switch on, the open world falls to the lowest SLOD.The fix I'm using: broadcast the scalar first, then multiply by a pre-scaled table:
<table>is a 16-byte-aligned[t0²·s², t1²·s², t2²·s², 0.0], built once from the title's own table atWORLD_LOD_TABLE_RVA. It still clobbers onlyraxandxmm1. The unit tests that pin the current bytes (code[9..14]=vshufps xmm1, xmm1, xmm1, 0,code[30..34]=vmulps xmm1, xmm1, xmm0, and the count of that opcode) would need updating too.I hit the original bug in play on an RX 6650 XT (Series S profile): the open world dropped to SLOD with the switch on. The fix above I verified by disassembly only. I haven't played with the switch on since the fix.
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.