upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/d3d12_command_objects.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/d3d12_command_objects.md')
-rw-r--r--docs/d3d12_command_objects.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md
index 3de97436e..0c94f58c7 100644
--- a/docs/d3d12_command_objects.md
+++ b/docs/d3d12_command_objects.md
@@ -544,6 +544,27 @@ them, and it is the simplest contract for a layer that does not want to decode t
544executable makes the same check before writing is unknown until it is available; it is compiled against the same 544executable makes the same check before writing is unknown until it is available; it is compiled against the same
545console headers. 545console headers.
546 546
547**Every inline write in the package's DLLs checks first.** `tools/inline_scan.py` finds each cursor store-back
548(`mov [list+18h],reg` after stores through the cursor) and looks for the compare in front of it. On the 1.0.2.1
549DLLs (dumpbin 14.44 listings):
550
551| Image | Inline writes | Checked | Not checked | Limit compared | Fallback slot (sites) |
552|---|---:|---:|---:|---|---|
553| `XboxBvhBuilder.dll` | 196 | 196 | 0 | `+0x30` ×165, `+0x28` ×30, a register loaded in another block ×1 | 45 ×71, 37 ×35, 25 ×34, 14 ×24, 39 ×16, 43 ×9, 80 ×4; 3 reach theirs through a shared jump the tool does not follow |
554| `amd_fidelityfx_upscaler_xbox.dll` | 9 | 9 | 0 | `+0x30` ×8, `+0x28` ×1 | 35 ×6, 25, 41, 14 |
555
556**Measured.** The packet headers it reads back are the two dispatch forms above: `0x4002c400` (26 four-word
557dispatches in the builder, one in FSR) and `0x4003cc00` (the builder's four five-word ones). The other 14 DLLs have
558no inline write, except one checked site in `libHttpClient.GDK.dll`, which imports nothing from D3D12: read a
559result as an upper bound of about one site per image. Removing the compare and branch in front of the builder's
560`0x14972` write turns exactly that site into "not checked", so a missing check is visible.
561
562On the executable, `python -I tools/inline_scan.py <exe> --sites` answers the question in one pass (see the day-one
563list in `docs/design.md`): no unchecked site means a cursor-at-limit layer sees every command the game records; each
564unchecked site is listed by RVA and is a write that layer never sees. Its fallback-slot line is the set of console
565list methods the game reaches through the vtable. Limit offsets other than `+0x28`/`+0x30` would be command kinds
566the DLLs never write (draws, input-assembler and output-merger state); read a few of those sites by hand.
567
547**The five-word dispatch.** The BVH builder also writes `0x4003cc00, x, 1, 1, W`: 568**The five-word dispatch.** The BVH builder also writes `0x4003cc00, x, 1, 1, W`:
548 569
549- **Sites:** `0x14972`, `0x15215`, `0x1536a` and `0x1d002`, each checked against the dispatch limit `+0x28`. The 570- **Sites:** `0x14972`, `0x15215`, `0x1536a` and `0x1d002`, each checked against the dispatch limit `+0x28`. The