Improve SGD5 shader group parser #29
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/rpatty-dev--PercyStar!29
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/29/head"
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?
@Xyzstk on GitHub · 2026-11-22 00:01 UTC · original
Xyzstk:sgd5-fssm-rdna2→main· +1130 −155 · 4 files · 2 commits · merged 2026-11-22 02:23 UTCSummary
This adds a structural
SGD5shader-group parser, raw archive stream discovery,DXBC/FSSMextraction, and unified RDNA2 inspection in the Shaders page. It also resolves readable resource names through effect reflection string pools and applies them to disassembly and the experimental HLSL/SPIR-V views.The format details are intentionally kept out of the repository and documented here instead.
SGD5 container layout
All values are little-endian. Size fields describe the bytes that follow them and do not include the size field itself.
The container starts with:
A shared reflection block follows. It contains
referenced_count + extra_count24-byte records:Each reflection record is:
Six shader arrays then follow in
VS, PS, GS, DS, HS, CSorder.Shader array and DXBC/FSSM payload
Each shader is:
The payload is DEFLATE-compressed and expands to a
DXBCcontainer. TheDXBCprivate data contains a zlib-compressedFSSMpayload, andFSSMexposes raw GFX10.3/RDNA2 code through its code offset and size fields. That code is fed into the existing RDNA2 decoder and HLSL/SPIR-V lifters.This means the
SGD5path and the independent runtime-cache path share the same machine-code decoder and viewer infrastructure.Effect blobs
The effect array begins with a
u32 effect_count, followed by variable-sized effect blobs:This replaces earlier reflection-table scanning with a deterministic grammar. In the current sample, 872 effects have no extension, 56 have one extension, and four have two extensions. One effect combines an extension, continuation, and state chunks.
Reflection and property tables
The main effect reflection table contains resource records, cbuffer-member records, texture entries, a string pool, and float defaults:
A secondary reflection table follows, then the property section:
Resource names use the lowercased Jenkins one-at-a-time hash. Both plain and
_-prefixed sampler forms are indexed, matching the behavior of the older version’s parser. Resolved names are attached to matching shader reflection records and shown in the RDNA2 views.GUI and CLI integration
SGD5stream through one source-switching flow.SGD5shader rows show effect associations, and selected shaders show their effect names.DXBC/FSSMinformation and resolved resource names are displayed alongside the RDNA2 code.DXBCfiles and manifests.The final stream trailer is ten bytes: a
u32 flagsvalue followed by six zero bytes. Unrelated archive data can follow the lastSGD5stream, so trailer validation no longer requires EOF or anotherSGD5magic.Validation
cargo test -q: 42 tests; 39 passed, 3 ignored.SGD5groups, 26,503 shaders, and 932 effects parsed.git diff --checkis clean.Remaining unknowns
group_hash, descriptor hashes, property hashes, and shadersga_hashremain opaque 64-bit values.@rpatty-dev on GitHub · 2026-11-22 02:23 UTC · original
Merged onto main and pre-sized resolve_hashed_names HashMap capacity in commit
6687bcdto avoid repeated rehashing on large shader string pools (52/52 tests + release build passing). Awesome SGD5/FSSM parser!