Shaders: trace a geometry program's signature memory #3222
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3222
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3222"
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?
@kotekompotek on GitHub · 2026-11-26 13:37 UTC · original
kotekompotek:shader/geometry-signature-memory→main· +46 −9 · 1 files · 1 commits · openGrand Theft Auto VI's
GS_VoxelizeGenericprograms (all 195 of them - the single biggest refusal bucket invictory translate --list shaders.rpf) keep the pointer to their root signature memory in user data 0-1 - their first user SGPRs, s[8:9] - and load through it like a compute program does through s[0:1]:spill_loadswas gated onHwStage::Cs, so the base address wasn't recognized asUSER_DATAmemory and the program was refused with "an address in an SGPR that is no root parameter".Now
spill_loadsandparam_word's spilled path admitHwStage::Gs, reading the pointer fromstage.user_sgpr(0..1)instead of hardcoding s[0:1]. A geometry program's signature memory is there whenever user data 0-1 holds no parameter (it doesn't need the >16-dwords overflow condition compute has).Verified on six real
GS_VoxelizeGenericprograms extracted fromshaders.rpf(v1.0.2.1) - all six now trace toUSER_DATAaddresses instead of failing. Regression test synthesizes the prologue + load.@Venom2054 on GitHub · 2026-11-26 13:45 UTC · original
I repeated the resource-tracking test on all 195 distinct
GS_VoxelizeGenericgeometry shader containers in my local index, using the same inputs on the parent63bcca43and PR head879f2126.resource::trackrefused all 195 at instruction0x44because it could not identify the address in the scalar register pair.resource::tracksucceeded for all 195. In each case it identified one load fromUSER_DATAat that instruction.emit::translateentry point, both revisions still refused all 195 at stage selection, before producing DXIL. A separate compute control emitted 2,160 bytes of DXIL and passed the Windows SDK validator on both revisions.This confirms the signature-memory fix across the whole family. It leaves geometry-stage translation and in-game rendering as separate checks. Codex assisted with the offline comparison.
@Dukestar69 on GitHub · 2026-11-26 13:50 UTC · original · approved these changes
Verified against
origin/main(63bcca4):cargo test -p victory-shader --lib resource::tests:: -- --test-threads=1: 36/36 passed (includinga_geometry_programs_signature_memory_loads_through_its_pointer).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly traces a geometry program's signature memory loads through its pointer.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@kotekompotek on GitHub · 2026-11-26 18:15 UTC · original
Full-pack verification,
victory translate --liston the shipped shaders.rpf (v1.0.2.1, 26 503 containers, 26 084 programs):The 195 programs do not just track now — they emit: mesh programs stay 8 765 / 8 765 emitted. Every remaining refusal in the pack is a different, already-accounted bucket (13 lane-mask join — FIND-6; 5 v_cvt_f32_f64 — #1262; 4 lane mask read as data — FIND-6; 1 descriptor read only as data — #329; 1 barycentrics; 1 v_permlanex16_b32).
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.