Repository navigation
tombox-xshader: read the root-signature table in the FSSM header (GTA VI) - #41
Open
fffluffy-dev wants to merge 1 commit into
Open
fffluffy-dev wants to merge 1 commit into
fffluffy-dev wants to merge 1 commit into
Conversation
GTA VI's shaders carry no RTS0 chunk; their root-signature layout is a table inside the FSSM header (format from omonkeyz#54, validated there on 26,502 GTA VI shaders): - u8[0xD6] user SGPR count, u32[0xF8] entry count, u32[0xE8] = 0xDEADBEEF for no table, u32[0xF0] points 4 bytes into the last 20-byte entry; - an entry is kind, offset in dwords, count, register, loc, where loc = rootParam << 8 | userSgpr; - kinds: 0 root constants, 1 root descriptor, 3 descriptor in a table, 4 static sampler, 5 resource heap base, 6 sampler heap base; - merged and NGG stages start user data at s8. meta::fssm_root_table parses it and refuses tables that fall outside the blob; xshader prints it. Nothing consumes it yet: the translator still takes the memory-descriptor path for these shaders (#24). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vTZArnDeG1xtBcLprpoCq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of #40.
meta::fssm_root_table(fssm)reads the root-signature table that GTA VI keeps in the FSSM header. The format comes from upstreamomonkeyz/xbox-emulator#54:u8[0xD6]is the user SGPR count;u32[0xF8]is the entry count;u32[0xE8] == 0xDEADBEEFmeans there is no table;u32[0xF0]points 4 bytes into the last entry;kind, offset, count, register, loc, withloc = rootParam << 8 | userSgpr.It returns
Nonefor a blob that is not FSSM, for a table outside the blob, and for more than 4096 entries.fssm_user_data_basereturns s8 for merged and NGG stages.xshaderprints the table.Nothing consumes the table yet. The translator keeps the memory-descriptor path for these shaders until step 3 of #40.
Tests: 4 new unit tests (
cargo test -p tombox-xshader --lib fssm_root) cover entries, no table, refusals, and kinds with the user-data base. No real GTA VI shader was used: none is in the repo, and checking on the package is step 2 of #40.Generated by Claude Code