diff options
Diffstat (limited to 'docs/d3d12_command_objects.md')
| -rw-r--r-- | docs/d3d12_command_objects.md | 150 |
1 files changed, 140 insertions, 10 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md index 56e1fd5cd..0c94f58c7 100644 --- a/docs/d3d12_command_objects.md +++ b/docs/d3d12_command_objects.md | |||
| @@ -112,6 +112,33 @@ texture-creation method at 76 where the PC interface has `CreateStateObject`/som | |||
| 112 | by that work.** They are the four calls a game must make before it can have a queue, allocator, | 112 | by that work.** They are the four calls a game must make before it can have a queue, allocator, |
| 113 | list or fence, so they are the first thing a trace must confirm. | 113 | list or fence, so they are the first thing a trace must confirm. |
| 114 | 114 | ||
| 115 | **They cannot be measured from the package either (D3D-350).** The package ships no D3D12 runtime: | ||
| 116 | the 16 DLLs in [`game/xbox-1.0.2.1.json`](../game/xbox-1.0.2.1.json) do not include | ||
| 117 | `d3d12_xs.dll`, which is part of the console OS, and the device clients that are shipped never call | ||
| 118 | these four slots. Measured on 1.0.2.1 (counts only): | ||
| 119 | |||
| 120 | | Image | `ID3D12*` IIDs it contains | Imports from `d3d12_xs.dll` | Calls at `0x40`/`0x48`/`0x60`/`0x120` on the device | | ||
| 121 | |---|---|---|---| | ||
| 122 | | `XboxBvhBuilder.dll` | `PipelineState`, `RootSignature` | `D3D12SerializeVersionedRootSignature` | none: no indirect call at any of the four offsets | | ||
| 123 | | `amd_fidelityfx_upscaler_xbox.dll` | `CommandSignature`, `DescriptorHeap`, `Device`, `Heap`, `PipelineState`, `Resource`, `RootSignature`, `RootSignatureDeserializer` | `D3D12CreateRootSignatureDeserializer` | none: the 3 calls at `0x40` are `ID3D12Resource::Map` on a resource it has just created, the 29 at `0x48` are `Close`/`Unmap`-shaped calls with no `(type, &IID, &out)` arguments, the 4 at `0x60` are a function-pointer field in a plain struct (no vtable load), and there are none at `0x120` | | ||
| 124 | | `amd_fidelityfx_loader_xbox.dll`, `Bink2Scarlett.dll` | none | none | — | | ||
| 125 | |||
| 126 | Neither image contains the IID of `ID3D12CommandQueue`, `ID3D12CommandAllocator`, | ||
| 127 | `ID3D12CommandList`, `ID3D12GraphicsCommandList`, `ID3D12Fence` or `ID3D12Fence1`, and neither | ||
| 128 | can take one from `d3d12_xs.dll`: each imports one function there and no GUID data (ordinals | ||
| 129 | 23–115). A creator called through `IID_PPV_ARGS` needs that IID, so these clients do not create | ||
| 130 | queues, allocators, lists or fences; they record into lists the game gives them. The interfaces | ||
| 131 | that *are* present are the positive control: they are what each client is known to create | ||
| 132 | (compute PSOs through slot 62, root signatures, descriptor heaps, and resources through slots 27 | ||
| 133 | and 76). The IID column is reproduced by `python -I tools/d3d12_iid_scan.py <package>/*.dll` | ||
| 134 | (`tests/test_d3d12_iid_scan.py`); the call-site column comes from `dumpbin /disasm` listings, | ||
| 135 | following each `0x40`/`0x48`/`0x60`/`0x120` call back to its receiver. | ||
| 136 | |||
| 137 | So the four slots' callers are in the game executable, which the package does not contain (the | ||
| 138 | same blocker as RT-5). Confidence for slots 8, 9, 12 and 36 stays **Open**: the table in §2.1 is | ||
| 139 | still the SDK baseline. Once the executable is available, `tools/d3d12_iid_scan.py` run on it | ||
| 140 | shows whether it carries these IIDs, and its call sites through them give the slots. | ||
| 141 | |||
| 115 | ### 2.2 Queue, allocator and fence | 142 | ### 2.2 Queue, allocator and fence |
| 116 | 143 | ||
| 117 | `ID3D12CommandQueue` is declared at `d3d12.h:8701`. It has 19 slots (0–18); its own methods start | 144 | `ID3D12CommandQueue` is declared at `d3d12.h:8701`. It has 19 slots (0–18); its own methods start |
| @@ -260,7 +287,7 @@ paragraph). Every call below except the two barriers is the fallback branch of a | |||
| 260 | 287 | ||
| 261 | | RVA | Vtable offset | Console slot → PC method | Observed arguments | Confidence | | 288 | | RVA | Vtable offset | Console slot → PC method | Observed arguments | Confidence | |
| 262 | |---:|---:|---|---|---| | 289 | |---:|---:|---|---|---| |
| 263 | | `0x2171e` | `+0xd0` | 26 → 26 `ResourceBarrier` | `NumBarriers=1`, `&{Type=2 (UAV), Flags=0, pResource=null}` | **Measured**: the shape is a global UAV barrier; slot 26 is the SDK `ResourceBarrier` | | 290 | | `0x2171e` | `+0xd0` | 26 → 26 `ResourceBarrier` | `NumBarriers=1`, `&{Type=2 (UAV), Flags=0, pResource=null}` | **Measured**: the shape is a global UAV barrier; slot 26 is the SDK `ResourceBarrier`; the site is gated (section 3.3b), so the call never fires in the shipping DLL | |
| 264 | | `0x1d9cb` | `+0x70` | 14 → 14 `Dispatch` | `(1, 1, 1)` | **Measured**: exact `Dispatch` shape | | 291 | | `0x1d9cb` | `+0x70` | 14 → 14 `Dispatch` | `(1, 1, 1)` | **Measured**: exact `Dispatch` shape | |
| 265 | | `0x1d85e` | `+0xc8` | 25 → 25 `SetPipelineState` | `RCX=list`, `RDX=[rdi+8]`: loaded at `0x1d7fa` and not changed before the call; the inline branch (`0x1d822`–`0x1d850`) copies 28 bytes from that object's `+0x10` | **Measured**: RDX is the pipeline the inline branch reads | | 292 | | `0x1d85e` | `+0xc8` | 25 → 25 `SetPipelineState` | `RCX=list`, `RDX=[rdi+8]`: loaded at `0x1d7fa` and not changed before the call; the inline branch (`0x1d822`–`0x1d850`) copies 28 bytes from that object's `+0x10` | **Measured**: RDX is the pipeline the inline branch reads | |
| 266 | | `0x1d7f4` | `+0x108` | 33 → 29 `SetComputeRootSignature` | one argument, `RDX=[rcx]`: the pointer stored next to the pipeline (`[rdi]`; the pipeline is `[rdi+8]`) | **Measured** shape; agrees with slot 33 in section 3.5a | | 293 | | `0x1d7f4` | `+0x108` | 33 → 29 `SetComputeRootSignature` | one argument, `RDX=[rcx]`: the pointer stored next to the pipeline (`[rdi]`; the pipeline is `[rdi+8]`) | **Measured** shape; agrees with slot 33 in section 3.5a | |
| @@ -303,7 +330,6 @@ of an inline write of the same values. | |||
| 303 | | `0x1a3b0` | `+0x168` | 45 → 41 `SetComputeRootUnorderedAccessView` | `(0, VA)` (inline: header + a 64-bit value) | **Measured** shape | | 330 | | `0x1a3b0` | `+0x168` | 45 → 41 `SetComputeRootUnorderedAccessView` | `(0, VA)` (inline: header + a 64-bit value) | **Measured** shape | |
| 304 | | `0x20ed6` | `+0x4a0` | 148 → none | `(list, count * 40, 16)` returns a pointer; on null the DLL prints `D3D12 XDXR Error: Failed to allocate upload buffer` and throws `E_FAIL` | **Measured**: an upload allocator `(size, alignment)` | | 331 | | `0x20ed6` | `+0x4a0` | 148 → none | `(list, count * 40, 16)` returns a pointer; on null the DLL prints `D3D12 XDXR Error: Failed to allocate upload buffer` and throws `E_FAIL` | **Measured**: an upload allocator `(size, alignment)` | |
| 305 | | `0x20f99` | `+0x158` | 43 → 39 `SetComputeRootShaderResourceView` | `(0, p)`, `p` the pointer slot 148 returned at `0x20ed6`, unchanged | **Measured**: the CPU pointer is used as the GPU address | | 332 | | `0x20f99` | `+0x158` | 43 → 39 `SetComputeRootShaderResourceView` | `(0, p)`, `p` the pointer slot 148 returned at `0x20ed6`, unchanged | **Measured**: the CPU pointer is used as the GPU address | |
| 306 | | `0x149ba` | `+0x280` | 80 → none | `(x, 1, 1, 0x8020)`: `EDX=EDI`, `R8D=R9D=1`, fifth argument `0x8020` (inline: the five-dword packet `0x4003cc00, x, 1, 1, W` of section 3.5a; the calls at `0x1525d` and `0x153b4` pass `0x20`) | Inferred: a `Dispatch` with one extra word | | ||
| 307 | | `0x149ba` | `+0x280` | 80 → none | `(x, 1, 1, 0x8020)`: `EDX=EDI`, `R8D=R9D=1`, fifth argument `0x8020` (inline: the five-dword packet `0x4003cc00, x, 1, 1, W` of section 3.5a; the calls at `0x1525d` and `0x153b4` pass `0x20`, the one at `0x1d047` `0x8020`) | Inferred: a `Dispatch` with one extra word | | 333 | | `0x149ba` | `+0x280` | 80 → none | `(x, 1, 1, 0x8020)`: `EDX=EDI`, `R8D=R9D=1`, fifth argument `0x8020` (inline: the five-dword packet `0x4003cc00, x, 1, 1, W` of section 3.5a; the calls at `0x1525d` and `0x153b4` pass `0x20`, the one at `0x1d047` `0x8020`) | Inferred: a `Dispatch` with one extra word | |
| 308 | | `0xd6de` | `+0x238` | 71 → none | `(&label, counter, 0 or 0x1000, 0)`: the counter at `[rbx+0x9c]` is incremented first; `0x1000` on the last item of a batch | Inferred: a GPU write of a 32-bit value to memory | | 334 | | `0xd6de` | `+0x238` | 71 → none | `(&label, counter, 0 or 0x1000, 0)`: the counter at `[rbx+0x9c]` is incremented first; `0x1000` on the last item of a batch | Inferred: a GPU write of a 32-bit value to memory | |
| 309 | | `0xd679` | `+0x248` | 73 → none | `(&label, 3, reference, 0xffffffff, 0)` | Inferred: a GPU wait until the masked value compares (function 3) with the reference | | 335 | | `0xd679` | `+0x248` | 73 → none | `(&label, 3, reference, 0xffffffff, 0)` | Inferred: a GPU wait until the masked value compares (function 3) with the reference | |
| @@ -324,6 +350,71 @@ That byte is one of seven bools at `0xd7738`–`0xd773e` in zero-initialised `.b | |||
| 324 | the shipping DLL the label path is unreachable unless something writes that byte through a computed pointer, and | 350 | the shipping DLL the label path is unreachable unless something writes that byte through a computed pointer, and |
| 325 | the barrier path is the one that runs. | 351 | the barrier path is the one that runs. |
| 326 | 352 | ||
| 353 | ### 3.3b The batched build validates the geometry descriptors on the CPU first | ||
| 354 | |||
| 355 | A logging-proxy harness (section 7, item 1) never reached the first list-vtable call: both runs of the | ||
| 356 | batched export faulted at RVA `0x142d3`, before the object received in the command-list parameter was | ||
| 357 | touched once. The reason is a CPU-side validation of the build items that the section 7 descriptor | ||
| 358 | guidance did not cover. The batched entry (`0x216a0`) reaches it through `0xe6a0` (call at `0x216dc`), | ||
| 359 | the packet processor `0xcc00` (call at `0xe781`) and a per-record validator at `0x14270` (call at | ||
| 360 | `0xce18`; a second call site exists at `0x11c25`). The processor walks the batched descriptor's 80-byte | ||
| 361 | build items (item `i` at descriptor `+ i*0x50`) and routes each by the dword at its `+0x08` — the | ||
| 362 | pointer's `+0x00` at the validator: kind 1 reaches the validator, kind 0 goes through `0xc820`/`0xc780` | ||
| 363 | instead, other values take an error path (`0xd52f`). The validator reads, from the pointer it receives | ||
| 364 | (all **measured** in the static disassembly): | ||
| 365 | |||
| 366 | | Offset | Field | Check | | ||
| 367 | |---:|---|---| | ||
| 368 | | `+0x08` | descriptor count | loop bound | | ||
| 369 | | `+0x0c` | elements layout (`D3D12_ELEMENTS_LAYOUT`) | 0 = inline array of 0x38-byte records, 1 = array of pointers to records; other values print `D3D12 XDXR Error: Unexpected value for D3D12_ELEMENTS_LAYOUT` and throw `E_INVALIDARG` | | ||
| 370 | | `+0x10` | descriptor base | mode 0: record `i` at `base + i*0x38`; mode 1: record `i` at `[base + i*8]` | | ||
| 371 | | record `+0x00` | geometry type (`D3D12_RAYTRACING_GEOMETRY_TYPE`) | 0 = triangles, 1 = AABBs; others print `D3D12 XDXR Error: Unrecognized D3D12_RAYTRACING_GEOMETRY_TYPE` and throw `E_INVALIDARG` | | ||
| 372 | | record `+0x08` | AABB count (type 1) | accumulated | | ||
| 373 | | record `+0x10` | index format (type 0) | at most `0x39` and in the bitset `0x0220040000000000` — `DXGI_FORMAT_R32_UINT` (42), `DXGI_FORMAT_R16_TYPELESS` (53), `DXGI_FORMAT_R16_UINT` (57); others print `D3D12 XDXR Error: Unsupported index buffer format provided` and throw `E_NOTIMPL` | | ||
| 374 | | record `+0x18` | index count (type 0, format ≠ 0) | exact multiple of 3; otherwise prints `D3D12 XDXR Error: Triangle index count must be a multiple of 3 when an index buffer is provided` and throws `E_INVALIDARG` | | ||
| 375 | | record `+0x1c` | vertex count (type 0, format = 0) | checked instead of the index count, also an exact multiple of 3; otherwise prints `D3D12 XDXR Error: Triangle vertex count must be a multiple of 3 when no index buffer is provided` and throws `E_INVALIDARG` | | ||
| 376 | |||
| 377 | The fault that stopped the dynamic runs is the base dereference itself: at `0x142d3` (`mov ecx,[rdx]`, | ||
| 378 | `rdx = base + i*0x38` in the inline mode) the record's type word is read with a CPU load, so a descriptor | ||
| 379 | whose base is a GPU address that is not CPU-readable faults there. For a replacement runtime this is a | ||
| 380 | measured host-side contract: the geometry descriptors must be backed by CPU-readable memory, not only by | ||
| 381 | the GPU arena. The validator returns the summed primitive count (the triangle counts ÷ 3 plus the AABB | ||
| 382 | counts), which the packet processor stores (`0xce1d`). It reads nothing past record `+0x1f`; what the | ||
| 383 | `+0x20..+0x37` tail of a record is used for is open — the dynamic runs stopped at the first record read. | ||
| 384 | |||
| 385 | The same static pass settles what the first list calls would have been, and finds that three of the sites | ||
| 386 | section 3.3 and 3.3a list or miss are gated by the zero-initialised bytes of section 3.3a, so in the | ||
| 387 | shipping DLL they never run: | ||
| 388 | |||
| 389 | - The `+0xd0` `ResourceBarrier` at `0x2171e` (section 3.3) needs a non-zero item count (`0x216e1`) and the | ||
| 390 | byte at `0xd773c` (`0x216e9`). Its shape stays as measured; in the shipping DLL the call never fires. | ||
| 391 | - Slot 90 (`+0x2d0`, call at `0xe836`) is new — it is not in the section 3.3a tail list. Its shape is | ||
| 392 | `(list, p, 0, last)`: `RDX = [item+0x28] + [item+0x54]*4`, where `item` is one 160-byte element of the | ||
| 393 | processor's output array, selected through the dword array beside it, `R9 = 1` on the last iteration, | ||
| 394 | and the element's dword at `+0x9c` is cleared first. The loop is behind the same `0xd773c` byte | ||
| 395 | (`0xe7d0`) and the count check, so it does not run in the shipping DLL either. | ||
| 396 | - The direct slot-146 barrier at `0xea99` is behind the adjacent byte `0xd773b` (`0xea41`, after the | ||
| 397 | per-item callback reports true); the wrapper calls at `0xebbb`, `0xec79`, `0xed37` and `0xee17` are not | ||
| 398 | gated by these bytes, and each ends in the measured slot-146 global UAV barrier (section 3.3a). | ||
| 399 | |||
| 400 | The path also reads one byte past the seven bools of section 3.3a: `0xd773f` at `0xce3f` and `0x11c35`. | ||
| 401 | A linear sweep of `.text` finds no writes to `0xd7738`–`0xd773f` (only `cmp`/`movzx` reads; the two `lea` | ||
| 402 | sites take the address of `0xd7740`, one past the last byte), so the read-only range is eight bytes. | ||
| 403 | |||
| 404 | With the gated sites removed, the shipping-DLL order for one item is (measured with a postbuild-info | ||
| 405 | type of 2, which routes to the `0x1d7c0` worker): the validation above → slot 146 four times through | ||
| 406 | the `0xd580` wrapper → the upload function `0x20ea0` (called at `0xee85`; a second site at `0xf0f9`): | ||
| 407 | slot 148 for `count * 40` bytes at alignment 16 (`0x20ed6`; the size is | ||
| 408 | `lea edx,[rsi+rsi*4]; shl edx,3`), root signature (33), pipeline (25, or its inline write), the | ||
| 409 | slot-148 pointer as root SRV (43, or inline), the count as a 32-bit root constant (37), and | ||
| 410 | `Dispatch((count+31)/32, 1, 1)` (`0x21054`, or its inline four-word packet) — then the per-entry | ||
| 411 | worker `0x1d7c0` (called at `0x217d0`) whose sequence section 3.3 lists, ending in the slot-146 | ||
| 412 | barrier at `0x1da02`. Postbuild-info types 0 and 3 route to the mirrored worker `0x1d540` (called at | ||
| 413 | `0x217e2`). Slot 148 is therefore asked before the per-entry dispatch, and the first dispatch on the | ||
| 414 | path is the upload function's own — the two refinements to section 7's prediction. The `+0x490` barrier | ||
| 415 | arguments (one global UAV group `{0x80, 0x80, 0x10, 0x10}`) and slot 148's `count * 40`/16 are confirmed | ||
| 416 | by both passes (D3D-293's static disassembly and this section's independent iced-x86 re-check). | ||
| 417 | |||
| 327 | ### 3.4 The object is wider than the public vtable | 418 | ### 3.4 The object is wider than the public vtable |
| 328 | 419 | ||
| 329 | The inner function at `0x1d7c0` receives the command-list pointer in RDX, copies it to RBX | 420 | The inner function at `0x1d7c0` receives the command-list pointer in RDX, copies it to RBX |
| @@ -453,6 +544,27 @@ them, and it is the simplest contract for a layer that does not want to decode t | |||
| 453 | executable makes the same check before writing is unknown until it is available; it is compiled against the same | 544 | executable makes the same check before writing is unknown until it is available; it is compiled against the same |
| 454 | console headers. | 545 | console headers. |
| 455 | 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 | ||
| 549 | DLLs (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 | ||
| 557 | dispatches in the builder, one in FSR) and `0x4003cc00` (the builder's four five-word ones). The other 14 DLLs have | ||
| 558 | no inline write, except one checked site in `libHttpClient.GDK.dll`, which imports nothing from D3D12: read a | ||
| 559 | result 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 | |||
| 562 | On the executable, `python -I tools/inline_scan.py <exe> --sites` answers the question in one pass (see the day-one | ||
| 563 | list in `docs/design.md`): no unchecked site means a cursor-at-limit layer sees every command the game records; each | ||
| 564 | unchecked site is listed by RVA and is a write that layer never sees. Its fallback-slot line is the set of console | ||
| 565 | list methods the game reaches through the vtable. Limit offsets other than `+0x28`/`+0x30` would be command kinds | ||
| 566 | the DLLs never write (draws, input-assembler and output-merger state); read a few of those sites by hand. | ||
| 567 | |||
| 456 | **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`: |
| 457 | 569 | ||
| 458 | - **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 |
| @@ -615,7 +727,12 @@ Command allocators get the same kind of proxy: device slot 9 (`CreateCommandAllo | |||
| 615 | 727 | ||
| 616 | - **What is forwarded.** The public chain, 9 slots: the base chain and `Reset` at 8. A slot past it, up to the | 728 | - **What is forwarded.** The public chain, 9 slots: the base chain and `Reset` at 8. A slot past it, up to the |
| 617 | end of a 64-slot table, is logged and refused, and a read past the table faults in its own guard region. | 729 | end of a 64-slot table, is logged and refused, and a read past the table faults in its own guard region. |
| 618 | The console allocator's extra methods are not measured. | 730 | The console allocator's extra methods cannot be measured from the package (D3D-360). No shipped module creates, |
| 731 | receives or calls an allocator (§3.5). The package has no `d3d12_xs.dll` either, and no export of the three | ||
| 732 | D3D12 clients takes an allocator. `dumpbin /exports` (MSVC 19.52) lists the BVH builder's 12 exports, which take | ||
| 733 | an `ID3D12Device11` or a command list (`docs/d3d12_xs_surface.md`), and the FSR loader's and upscaler's | ||
| 734 | `ffxConfigure`, `ffxCreateContext`, `ffxDestroyContext`, `ffxDispatch` and `ffxQuery`. A call past slot 8 could | ||
| 735 | only show up in the game executable, which the package doesn't contain, so such a slot stays logged and refused. | ||
| 619 | - **Where a list takes it.** A list takes an allocator from the title in `CreateCommandList` and `Reset`, so | 736 | - **Where a list takes it.** A list takes an allocator from the title in `CreateCommandList` and `Reset`, so |
| 620 | the proxy is safe only where the list side resolves it. Slot 9 therefore wraps an allocator only when it | 737 | the proxy is safe only where the list side resolves it. Slot 9 therefore wraps an allocator only when it |
| 621 | answers `kLeonidaCommandAllocatorTag` (`d3d12_xs_device.h`). That is the Vulkan layer's own allocator, whose | 738 | answers `kLeonidaCommandAllocatorTag` (`d3d12_xs_device.h`). That is the Vulkan layer's own allocator, whose |
| @@ -692,16 +809,22 @@ return has been measured. | |||
| 692 | The executable is absent, so the next step should use the one shipped client that exists rather | 809 | The executable is absent, so the next step should use the one shipped client that exists rather |
| 693 | than invent slots. | 810 | than invent slots. |
| 694 | 811 | ||
| 695 | 1. **Confirm sections 3.3 and 3.3a with a logging proxy.** Create a test-only command | 812 | 1. **Confirm sections 3.3, 3.3a and 3.3b with a logging proxy.** Create a test-only command |
| 696 | list whose public GCL6/GCL8 vtable logs `(slot, raw arguments)` and whose tail is a page of | 813 | list whose public GCL6/GCL8 vtable logs `(slot, raw arguments)` and whose tail is a page of |
| 697 | logged unknown slots. Pass it to | 814 | logged unknown slots. Pass it to |
| 698 | `XboxBvhBuilder::BuildRaytracingAccelerationStructureBatched2X` with a minimal non-empty | 815 | `XboxBvhBuilder::BuildRaytracingAccelerationStructureBatched2X` with a minimal non-empty |
| 699 | descriptor. The `+0xd0` barrier and `+0x70` dispatch should be observed first; the `+0x490` | 816 | descriptor. The proxy ran twice; both runs stopped one step short, at the CPU-side geometry |
| 700 | call should arrive with one global UAV barrier group (section 3.3), and slot 148 should be | 817 | validation of section 3.3b (fault at `0x142d3`), before the first list call. The static pass |
| 701 | asked for `count * 40` bytes. Keep the cursor at its limit so every call reaches the vtable. If the | 818 | settled what the first calls will be: not the `+0xd0` barrier — it is gated and never fires |
| 702 | builder validates its inputs before reaching the dispatch, use a descriptor shaped like the | 819 | in the shipping DLL — but the wrapper's slot-146 barriers, then the upload function's slot |
| 703 | one its own `GetRaytracingAccelerationStructurePrebuildInfo` accepts (prior art measured a | 820 | 148 for `count * 40` bytes and its own `Dispatch((count+31)/32, 1, 1)`, and only then the |
| 704 | 3,000-vertex triangle geometry; the prebuild answer is 204,800 bytes / 128,704 scratch). | 821 | per-entry `Dispatch(1,1,1)` of section 3.3; the other new slot, 90, is gated too |
| 822 | (section 3.3b). Keep the cursor at its limit so every call reaches the vtable, and back the | ||
| 823 | geometry descriptors with CPU-readable memory holding valid 0x38-byte records per section 3.3b | ||
| 824 | (type 0, index format 0, vertex count a multiple of 3 — prior art measured a 3,000-vertex | ||
| 825 | triangle geometry; the prebuild answer is 204,800 bytes / 128,704 scratch). A descriptor shaped | ||
| 826 | like the one `GetRaytracingAccelerationStructurePrebuildInfo` accepts is not enough by itself, | ||
| 827 | because the validation reads the records with CPU loads. | ||
| 705 | 2. **GCL8 is now implemented** in PR #164 (public slot 81, recorded/reset, CTest 9/9); the | 828 | 2. **GCL8 is now implemented** in PR #164 (public slot 81, recorded/reset, CTest 9/9); the |
| 706 | builder's `+0x490` is `Barrier` (section 3.3), and its slot 148 needs an upload allocator (section 3.3a). | 829 | builder's `+0x490` is `Barrier` (section 3.3), and its slot 148 needs an upload allocator (section 3.3a). |
| 707 | 3. **When the executable appears, trace the four creation calls first.** Per-slot counters on | 830 | 3. **When the executable appears, trace the four creation calls first.** Per-slot counters on |
| @@ -749,6 +872,13 @@ the SDK; the console GUIDs are attributed to SCARAB in | |||
| 749 | `call [reg+disp]` sites in the rest of `.text` whose object register holds the list pointer, | 872 | `call [reg+disp]` sites in the rest of `.text` whose object register holds the list pointer, |
| 750 | each read with the argument registers set before it and the inline write it falls back from; | 873 | each read with the argument registers set before it and the inline write it falls back from; |
| 751 | the barrier constant is the 16 bytes at RVA `0xcdf60` (file offset from the section table). | 874 | the barrier constant is the 16 bytes at RVA `0xcdf60` (file offset from the section table). |
| 875 | - Section 3.3b and the gated sites: a second, independent disassembly pass (iced-x86, run for the | ||
| 876 | D3D-293 measurement) of the batched entry, the validation chain (`0xe6a0`, `0xcc00`, `0x14270`), | ||
| 877 | the upload function `0x20ea0` and the wrapper call sites; the dynamic side is D3D-293's | ||
| 878 | logging-proxy harness, whose two runs faulted at `0x142d3` before the first list call. The | ||
| 879 | quoted validation messages are the DLL's own wide strings at the `.rdata` addresses the throw | ||
| 880 | paths load. The gate-byte sentence is a linear sweep of `.text` collecting memory operands | ||
| 881 | targeting `0xd7738`–`0xd773f`. | ||
| 752 | - Public slots: parse the `MIDL_INTERFACE`/`virtual` declarations in `d3d12.h`; the counts in | 882 | - Public slots: parse the `MIDL_INTERFACE`/`virtual` declarations in `d3d12.h`; the counts in |
| 753 | section 2 include the seven `IUnknown`+`ID3D12Object` slots. Cross-check selected values with | 883 | section 2 include the seven `IUnknown`+`ID3D12Object` slots. Cross-check selected values with |
| 754 | `python tools/d3d12_xs_surface.py --check --sdk` (116 slots, 83 standard GUIDs) and | 884 | `python tools/d3d12_xs_surface.py --check --sdk` (116 slots, 83 standard GUIDs) and |