diff options
| author | ubiquitarianism <283527159+ubiquitarianism@users.noreply.github.com> | 2026-11-25 00:43:38 -0500 |
|---|---|---|
| committer | ubiquitarianism <283527159+ubiquitarianism@users.noreply.github.com> | 2026-11-25 00:43:38 -0500 |
| commit | 79cf7e78cfa1eedcdbf69dcdf0a4f7d5ee7b7b00 (patch) | |
| tree | 287572619a84ed1cc28195ae2023d29f47e48d72 /docs | |
| parent | 156a056b85289eece6878fe2ba12c7c17c44ca96 (diff) | |
| parent | 570db1d58f67a3b899cc60f53055eeb86fc8ac3d (diff) | |
Merge #1281 (shader library keeps each compute state, select by code hash)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/shader_library.md | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/shader_library.md b/docs/shader_library.md index 8cf131ca4..a1b6a2301 100644 --- a/docs/shader_library.md +++ b/docs/shader_library.md | |||
| @@ -152,8 +152,11 @@ python -I tools/rdna2spirv.py <work>/library/disasm --out <work>/library/spirv | |||
| 152 | 152 | ||
| 153 | * It writes `fspx/<name>.code` and `fspx/<name>.json`, the layout `fspx_unpack.py` writes and `rdna2spirv.py` | 153 | * It writes `fspx/<name>.code` and `fspx/<name>.json`, the layout `fspx_unpack.py` writes and `rdna2spirv.py` |
| 154 | reads (`native_blob`, `cs_dispatch_state`). A compute program also gets `fspx/<name>.state`, its record's state | 154 | reads (`native_blob`, `cs_dispatch_state`). A compute program also gets `fspx/<name>.state`, its record's state |
| 155 | blob (FSPX kind 0) as it is, whose SHA-256 is the index's `fspx_state_sha256`; every compute program has exactly one | 155 | blob (FSPX kind 0) as it is, whose SHA-256 is the index's `fspx_state_sha256`; in the 1.0.2.1 `shaders.rpf` library, |
| 156 | (2,684 programs, 2,693 records). It also writes `index.json` with each program's stage, and | 156 | every compute program has one distinct state-blob index across `library.json`'s `compute` table (2,684 programs, |
| 157 | 2,693 records). A program that records use with different state blobs is written once per distinct state, the | ||
| 158 | first under its name and each further one as `<name>_state_<blob index>`, so each pair of keys has an entry | ||
| 159 | (the library measured above has no such program). It also writes `index.json` with each program's stage, and | ||
| 157 | `library.json` with the header and both pipeline tables, stage to program name. Programs are named | 160 | `library.json` with the header and both pipeline tables, stage to program name. Programs are named |
| 158 | `lib_<stage>_<index>`. | 161 | `lib_<stage>_<index>`. |
| 159 | * `--disasm` writes `disasm/<name>.s` for the code after the prologue, as `fspx_unpack.py --disasm` does. | 162 | * `--disasm` writes `disasm/<name>.s` for the code after the prologue, as `fspx_unpack.py --disasm` does. |
| @@ -162,6 +165,8 @@ python -I tools/rdna2spirv.py <work>/library/disasm --out <work>/library/spirv | |||
| 162 | interface. | 165 | interface. |
| 163 | * `--save` writes the reassembled library. A saved file is also accepted as input. | 166 | * `--save` writes the reassembled library. A saved file is also accepted as input. |
| 164 | * `--stages` limits the output to some stages. | 167 | * `--stages` limits the output to some stages. |
| 168 | * `--compute-hashes FILE` instead writes only the compute programs whose code has one of the SHA-256 digests listed | ||
| 169 | in `FILE` (`fspx_code_sha256`), with every state they are used with. A digest no compute program has is an error. | ||
| 165 | 170 | ||
| 166 | The output is game data and must stay in your work folder. `tests/test_shader_library.py` builds libraries and | 171 | The output is game data and must stay in your work folder. `tests/test_shader_library.py` builds libraries and |
| 167 | archives by hand and covers the header, both tables, the size checks, the search in an archive and the digest | 172 | archives by hand and covers the header, both tables, the size checks, the search in an archive and the digest |