diff options
| author | sanchaton <138723000+sanchaton@users.noreply.github.com> | 2026-11-23 16:36:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-23 09:36:48 -0600 |
| commit | 6c8eb8221e81de25d907f96f01f431947ea51236 (patch) | |
| tree | 69fa22714119b1fc1ed860c6585dcfb93e3710ee /docs/embedded_shaders.md | |
| parent | 8e3c7c72b79cabfbe8a2059fce56a5b99d6ddb51 (diff) | |
pe_shader_containers: read shader stage from PSV0 and document game_scarlett_master.exe's 10 embedded shaders (RT-5) (#6840)
Squash-merged after diff review of PR #6840 - pe_shader_containers: read shader stage from PSV0 and document game_scarlett_master.exe's 10 embedded shaders (RT-5)
Diffstat (limited to 'docs/embedded_shaders.md')
| -rw-r--r-- | docs/embedded_shaders.md | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/docs/embedded_shaders.md b/docs/embedded_shaders.md index bd766b50e..4f4cecde1 100644 --- a/docs/embedded_shaders.md +++ b/docs/embedded_shaders.md | |||
| @@ -25,18 +25,34 @@ python -I tools/pe_shader_containers.py <dll> --json <work>/containers.json --ex | |||
| 25 | 25 | ||
| 26 | ## 2. Inventory | 26 | ## 2. Inventory |
| 27 | 27 | ||
| 28 | The 16 DLLs and the package's root files were scanned. All the containers are in two DLLs: | 28 | The 16 DLLs and the package's root files were scanned first (`XboxBvhBuilder.dll` and `amd_fidelityfx_upscaler_xbox.dll`); `game_scarlett_master.exe` (RT-5) adds 10 more console containers: |
| 29 | 29 | ||
| 30 | | image | containers | bytes | min / median / max | chunks | | 30 | | image | containers | bytes | min / median / max | chunks | |
| 31 | |---|---:|---:|---:|---| | 31 | |---|---:|---:|---:|---| |
| 32 | | `XboxBvhBuilder.dll` | 52 | 674,404 | 4,072 / 7,454 / 74,508 | `SFI0 ISG1 OSG1 PSV0 RTS0 STAT ILDN HASH DXIL` | | 32 | | `XboxBvhBuilder.dll` | 52 | 674,404 | 4,072 / 7,454 / 74,508 | `SFI0 ISG1 OSG1 PSV0 RTS0 STAT ILDN HASH DXIL` | |
| 33 | | `amd_fidelityfx_upscaler_xbox.dll` | 29 | 289,656 | 1,764 / 5,176 / 42,616 | `SFI0 ISG1 OSG1 PSV0 RTS0 HASH ACCC` | | 33 | | `amd_fidelityfx_upscaler_xbox.dll` | 29 | 289,656 | 1,764 / 5,176 / 42,616 | `SFI0 ISG1 OSG1 PSV0 RTS0 HASH ACCC` | |
| 34 | | other 14 DLLs | 0 | 0 | — | — | | 34 | | other 14 DLLs | 0 | 0 | — | — | |
| 35 | | `game_scarlett_master.exe` | 10 | 9,520 | 924 / 936 / 992 | `SFI0 ISG1 OSG1 PSV0 HASH DXIL PRIV` | | ||
| 35 | 36 | ||
| 36 | The 29 `ACCC` containers hold `FSPX` payloads ([fspx.md](fspx.md)); the 52 `DXIL` containers are the subject of | 37 | The 29 `ACCC` containers hold `FSPX` payloads ([fspx.md](fspx.md)); the 52 `DXIL` containers are the subject of |
| 37 | this note. The FSR DLL has one rejected `DXBC` hit: the bytes are an immediate in its own magic check, and the | 38 | this note. The FSR DLL has one rejected `DXBC` hit: the bytes are an immediate in its own magic check, and the |
| 38 | validator rejects it (the scan reports both counts). | 39 | validator rejects it (the scan reports both counts). |
| 39 | 40 | ||
| 41 | ### Retail executable (`game_scarlett_master.exe`, RT-5) | ||
| 42 | |||
| 43 | Scanning the retail executable (120,181,760 bytes, SHA-256 `e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993`) | ||
| 44 | with `tools/pe_shader_containers.py` finds **10** valid DXBC containers (9,520 bytes total, file offsets | ||
| 45 | `0x688cd3c`..`0x688fdf6`, sizes 924–992 bytes) and 1 rejected `DXBC` hit: | ||
| 46 | |||
| 47 | * **Stages (`PSV0`):** **1** vertex shader (`0x688cd3c`, 992 bytes) and **9** pixel shaders (924–980 bytes). Unlike the | ||
| 48 | DLL containers above, none carries `ILDN`, `STAT`, `RTS0`, or LLVM bitcode (`has_bitcode = false`). All 10 carry | ||
| 49 | console-only `XBCH` (`XDAT` tag `0x0d`, 307–368 bytes) and `NOBC` (tag `0x07`, 28 bytes), plus a 12-byte `PRIV` chunk. | ||
| 50 | * **Translation and GPU check:** `tools/pe_shader_containers.py --extract` previously hardcoded `"stage": "cs"` in | ||
| 51 | `index.json`, causing `rdna2spirv.py` to reject all 10 with `CS group size`. With `stage` read from `PSV0`, all 10 | ||
| 52 | unpack via `tools/fssm_unpack.py` (10/10 `FSSM`, 1,245–4,176 bytes), disassemble cleanly via `tools/shader_disasm.py --backend python` | ||
| 53 | (10/10 clean), translate via `tools/rdna2spirv.py` (10/10 translated, all wave64 tier A), and pass `vk_pipeline_check` | ||
| 54 | on an NVIDIA GeForce RTX 5060 Laptop GPU (driver `617.14`, Windows 11): **10/10 modules and 10/10 pipelines OK** (1 VS, 9 PS, 0 failed, 0 skipped). | ||
| 55 | |||
| 40 | **Every one of the 52 containers carries two representations of its program:** | 56 | **Every one of the 52 containers carries two representations of its program:** |
| 41 | 57 | ||
| 42 | * an LLVM bitcode blob in the `DXIL` chunk (`BC C0 DE`, 1,820 to 70,276 bytes), and | 58 | * an LLVM bitcode blob in the `DXIL` chunk (`BC C0 DE`, 1,820 to 70,276 bytes), and |