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:
authorCLHelper <359823989+CLHelper@users.noreply.github.com>2026-11-22 19:37:45 +0000
committerCLHelper <359823989+CLHelper@users.noreply.github.com>2026-11-22 19:37:55 +0000
commitca438076bc73ac960e2743d7b0e092a457052fca (patch)
tree745906a24eb322874adf90fef1d192b5a51c8604 /docs/d3d12_command_objects.md
parent162821017ea3c286c8bec860f3ff94f037912061 (diff)
feat(tools): inline_scan finds inline command-list writes and whether each checks the cursor limit
The package's DLLs check before every inline write (BVH builder 196/196, FSR 9/9), so a layer that keeps the cursor at the limit sees every command. Whether the game's executable does the same was open until it is available; inline_scan answers it in one pass over a dumpbin listing. Baseline in d3d12_command_objects.md, day-one step in design.md.
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 56e1fd5cd..b72bf3696 100644
--- a/docs/d3d12_command_objects.md
+++ b/docs/d3d12_command_objects.md
@@ -453,6 +453,27 @@ them, and it is the simplest contract for a layer that does not want to decode t
453executable makes the same check before writing is unknown until it is available; it is compiled against the same 453executable makes the same check before writing is unknown until it is available; it is compiled against the same
454console headers. 454console headers.
455 455
456**Every inline write in the package's DLLs checks first.** `tools/inline_scan.py` finds each cursor store-back
457(`mov [list+18h],reg` after stores through the cursor) and looks for the compare in front of it. On the 1.0.2.1
458DLLs (dumpbin 14.44 listings):
459
460| Image | Inline writes | Checked | Not checked | Limit compared | Fallback slot (sites) |
461|---|---:|---:|---:|---|---|
462| `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 |
463| `amd_fidelityfx_upscaler_xbox.dll` | 9 | 9 | 0 | `+0x30` ×8, `+0x28` ×1 | 35 ×6, 25, 41, 14 |
464
465**Measured.** The packet headers it reads back are the two dispatch forms above: `0x4002c400` (26 four-word
466dispatches in the builder, one in FSR) and `0x4003cc00` (the builder's four five-word ones). The other 14 DLLs have
467no inline write, except one checked site in `libHttpClient.GDK.dll`, which imports nothing from D3D12: read a
468result as an upper bound of about one site per image. Removing the compare and branch in front of the builder's
469`0x14972` write turns exactly that site into "not checked", so a missing check is visible.
470
471On the executable, `python -I tools/inline_scan.py <exe> --sites` answers the question in one pass (see the day-one
472list in `docs/design.md`): no unchecked site means a cursor-at-limit layer sees every command the game records; each
473unchecked site is listed by RVA and is a write that layer never sees. Its fallback-slot line is the set of console
474list methods the game reaches through the vtable. Limit offsets other than `+0x28`/`+0x30` would be command kinds
475the DLLs never write (draws, input-assembler and output-merger state); read a few of those sites by hand.
476
456**The five-word dispatch.** The BVH builder also writes `0x4003cc00, x, 1, 1, W`: 477**The five-word dispatch.** The BVH builder also writes `0x4003cc00, x, 1, 1, W`:
457 478
458- **Sites:** `0x14972`, `0x15215`, `0x1536a` and `0x1d002`, each checked against the dispatch limit `+0x28`. The 479- **Sites:** `0x14972`, `0x15215`, `0x1536a` and `0x1d002`, each checked against the dispatch limit `+0x28`. The