Repository navigation
Shaders: trace a geometry program's signature memory - #3222
kotekompotek wants to merge 1 commit into
Conversation
Grand Theft Auto VI's GS_VoxelizeGeneric programs (all 195 of them) 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's s[0:1]. spill_loads only ran for compute, so the very first s_load at 0x44 failed with "an SGPR that is no root parameter" and every one of them was refused. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I repeated the resource-tracking test on all 195 distinct
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
left a comment
There was a problem hiding this comment.
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).
Import upstream Marvisak#3222: trace geometry signature memory
|
Full-pack verification,
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). |
|
NVIDIA full-suite run, to go with the reports above by Dukestar69, since none of them names a GPU run. Tested exact head Tested
Not tested
AI use
|
fuzeofficlal
left a comment
There was a problem hiding this comment.
Thanks for extending signature memory tracking to HwStage::Gs! One regression against main came up in param_word:
- GS register-backed root descriptors at
user_data >= 16lose their high half (crates/victory-shader/src/resource.rs:488, 546, 641, 941-943):
Line 546 now routes alluser_data >= 16lookups onHwStage::Cs | HwStage::Gsexclusively toself.first_spilled. However,spill_loads()explicitly skips spill scanning wheneverself.layout.iter().any(|p| p.user_data < 2 && p.sgprs > 0)(line 488), leavingself.first_spilledempty. Because merged GS stages have up to 32 user SGPRs (s[8 + user_data]), if a GS layout occupiesuser_data < 2and also passes aRootType::Descriptorin entry SGPRs atuser_data >= 16,param_of(line 641) matches the incoming SGPR, butparam_word(param, 1)now returnsNoneinstead of reading the incoming high SGPR (asmaindid), causing line 943 to fail with"a root descriptor without its high half".
Gating line 546 on whether signature memory is active for GS (e.g. if self.stage == HwStage::Cs || !self.layout.iter().any(|p| p.user_data < 2 && p.sgprs > 0), or falling back to entry SGPRs when self.first_spilled is empty on HwStage::Gs) preserves register-backed GS descriptors cleanly.
Grand 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.