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:
authorromainveurrier <romain.veurrier@gmail.com>2026-11-22 13:38:24 +0100
committerromainveurrier <romain.veurrier@gmail.com>2026-11-22 13:38:24 +0100
commit83f13ed569af4394786b108b490f61659352c2a5 (patch)
treea009d3b37e23ebd6e9e6faf34e23e0a88f794d24 /docs/d3d12_command_objects.md
parentc2215fc63539747cd8a771eb4183a88149867b27 (diff)
parent41f448261e1de8a410b4d760e69a7e5656cef858 (diff)
Merge remote-tracking branch 'origin/main' into rt/xdxr-gpu-builder-merge
# Conflicts: # runtime/CMakeLists.txt
Diffstat (limited to 'docs/d3d12_command_objects.md')
-rw-r--r--docs/d3d12_command_objects.md129
1 files changed, 96 insertions, 33 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md
index 0345af80e..3a346edff 100644
--- a/docs/d3d12_command_objects.md
+++ b/docs/d3d12_command_objects.md
@@ -254,21 +254,28 @@ batched paths.
254Disassembling the exported bodies and the functions they call directly gives these calls through 254Disassembling the exported bodies and the functions they call directly gives these calls through
255the object received in the command-list parameter: 255the object received in the command-list parameter:
256 256
257| RVA | Vtable offset | Public slot if PC order | Observed arguments | Confidence | 257The console list is not in PC order past slot 26 (section 3.5a), so the method column reads each call in the
258|---:|---:|---:|---|---| 258console order, from the arguments at the call and from the inline write it falls back from (section 3.5a, last
259| `0x2171e` | `+0xd0` | 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` | 259paragraph). Every call below except the two barriers is the fallback branch of an inline write of the same values.
260| `0x1d9cb` | `+0x70` | 14 `Dispatch` | `(1, 1, 1)` | **Measured**: exact `Dispatch` shape | 260
261| `0x1d85e` | `+0xc8` | 25 `SetPipelineState` | `RCX=list`; RDX is not re-set at the call site | Inferred: offset and object match; the pipeline argument is not proven | 261| RVA | Vtable offset | Console slot → PC method | Observed arguments | Confidence |
262| `0x1d7f4` | `+0x108` | 33 `SetComputeRoot32BitConstant` | root index, value and offset registers | Inferred | 262|---:|---:|---|---|---|
263| `0x1d8b9`, `0x1d956` | `+0x138` | 39 `SetComputeRootShaderResourceView` | `(root=3, value, …)` | Inferred | 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` |
264| `0x1d8f9` | `+0x168` | 45 `SOSetTargets` | `NumBuffers=0` (a no-op), resource in R8 | Inferred; `NumBuffers=0` means the view pointer is not read | 264| `0x1d9cb` | `+0x70` | 14 → 14 `Dispatch` | `(1, 1, 1)` | **Measured**: exact `Dispatch` shape |
265| `0x1da02` | `+0x490` | **none** | `(1, &{0, 1, pointer, …})` | **Measured offset**; method identity **Open** | 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 |
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 |
267| `0x1d8b9` | `+0x138` | 39 → 35 `SetComputeRoot32BitConstants` | `(3, 1, &value, offset)`: `EDX=3`, `R8D=EDX-2=1`, `R9=rsp+0x30`, fifth argument `EDI` | **Measured**: four arguments with a count and a source pointer; a root SRV takes two |
268| `0x1d956` | `+0x138` | 39 → 35 `SetComputeRoot32BitConstants` | `(3, count, source, offset)`: `R8D=EDI` (the count of the inline copy loop above it), `R9=RSI` | **Measured** |
269| `0x1d8f9` | `+0x168` | 45 → 41 `SetComputeRootUnorderedAccessView` | `(0, VA)`: `EDX=0`, `R8=RBP`; the inline branch writes a header word and the same 64-bit `RBP` (12 bytes) | **Measured**: a root index and a 64-bit address |
270| `0x1da02` | `+0x490` | 146 → GCL7 80 `Barrier` | `(1, &group)`, group `{Type=0, NumBarriers=1, pGlobalBarriers}`; the barrier is the 16 bytes at RVA `0xcdf60`: `{0x80, 0x80, 0x10, 0x10}` | **Measured**: the public `Barrier(UINT32, const D3D12_BARRIER_GROUP*)` shape with public enum values |
266 271
267The `+0x490` call is after the `Dispatch(1,1,1)` at `0x1d9cb`, in the per-descriptor path. It is 272The `+0x490` call is after the `Dispatch(1,1,1)` at `0x1d9cb`, in the per-descriptor path. It is
268**beyond the last public GCL8 slot**: slot 81 is `0x288`, so `0x490` is 65 slots past the end of 273**beyond the last public GCL8 slot** (slot 81 is `0x288`), but its arguments are the public enhanced-barrier
269the public chain. It is either an appended console command-list method or a method of an internal 274call: one `D3D12_BARRIER_GROUP` of type `D3D12_BARRIER_TYPE_GLOBAL` (0) holding one `D3D12_GLOBAL_BARRIER` with
270class that the helper receives through the command-list parameter; the evidence below favours the 275`SyncBefore = SyncAfter = D3D12_BARRIER_SYNC_COMPUTE_SHADING` (`0x80`) and
271second reading. Its arguments are not a public D3D12 method shape. 276`AccessBefore = AccessAfter = D3D12_BARRIER_ACCESS_UNORDERED_ACCESS` (`0x10`), values as in SDK 10.0.26100
277`d3d12.h`. On the PC that method is GCL7 slot 80; on the console list it is slot 146. A second call site with the
278same constant is `0xd7b4` (section 3.3a).
272 279
273The same two inner functions (`0x1d540` and `0x1d7c0`) contain the `+0x70`, `+0xc8`, `+0x108`, 280The same two inner functions (`0x1d540` and `0x1d7c0`) contain the `+0x70`, `+0xc8`, `+0x108`,
274`+0x138`, `+0x168` and `+0x490` calls; the outer batched function contains the `+0xd0` barrier. 281`+0x138`, `+0x168` and `+0x490` calls; the outer batched function contains the `+0xd0` barrier.
@@ -277,12 +284,45 @@ The exported `CopyRaytracingAccelerationStructure` (ordinal 5) and the rehydrate
277internal functions using objects cached in the builder (`[this+0x10]` and `[this+8]`). Their 284internal functions using objects cached in the builder (`[this+0x10]` and `[this+8]`). Their
278signatures still require GCL4/GCL8 objects, but those bodies do not measure command-list slots. 285signatures still require GCL4/GCL8 objects, but those bodies do not measure command-list slots.
279 286
287### 3.3a Other builder call sites past the PC order
288
289The rest of `.text` has further calls through the list pointer. Each name below rests on the call shape; "inline"
290means the call is the fallback of an inline write of the same values.
291
292| RVA | Vtable offset | Console slot → PC method | Observed arguments | Confidence |
293|---:|---:|---|---|---|
294| `0x1a1e9` | `+0x128` | 37 → 33 `SetComputeRoot32BitConstant` | `(2, value, 0)`: `EDX=R9D+2`, `R9D=0` (inline: header + one dword) | **Measured** shape |
295| `0x14e81` | `+0x138` | 39 → 35 `SetComputeRoot32BitConstants` | `(0, 19, rsp+0xc0, 0)` (inline: header + 19 dwords) | **Measured** shape |
296| `0x14e11` | `+0x158` | 43 → 39 `SetComputeRootShaderResourceView` | `(3, VA)`: `EDX=3`, `R8=R13` (inline: header + the 64-bit `R13`) | **Measured** shape |
297| `0x1a3b0` | `+0x168` | 45 → 41 `SetComputeRootUnorderedAccessView` | `(0, VA)` (inline: header + a 64-bit value) | **Measured** shape |
298| `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)` |
299| `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 |
300| `0x149ba` | `+0x280` | 80 → none | `(x, 1, 1, 0x8020)`: `EDX=EDI`, `R8D=R9D=1`, fifth argument `0x8020` (inline: a five-dword packet) | Inferred: a `Dispatch` with one extra word |
301| `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 |
302| `0xd679` | `+0x248` | 73 → none | `(&label, 3, reference, 0xffffffff, 0)` | Inferred: a GPU wait until the masked value compares (function 3) with the reference |
303| `0xd7b4` | `+0x490` | 146 → GCL7 80 `Barrier` | the same global UAV barrier as `0x1da02` | **Measured** |
304
305So the compute root-binding group keeps its PC order four slots later (33, 37, 39, 43 and 45 here; 35 and 41 in
306section 3.5a), and the console list has methods well past the PC tail: 71, 73, 80, 146 and 148 here, 141 in the
307FSR DLL.
308
309Slot 148 matters beyond the builder: the address it returns is written by the CPU and passed unchanged to the GPU
310as a root SRV address, so console upload memory has the same address for the CPU and the GPU. A replacement must
311return memory whose CPU pointer is also a valid GPU address (for this layer: inside the arena of
312[d3d12_vulkan.md §3.3](d3d12_vulkan.md)).
313
314The function at `0xd580` uses the 71/73 pair instead of the slot-146 barrier when the byte at RVA `0xd773c` is set.
315That byte is one of seven bools at `0xd7738`–`0xd773e` in zero-initialised `.bss`. The only accesses to them in
316`.text` are about 50 RIP-relative reads (`cmp`, `movzx`); there is no write and no export that points there. So in
317the shipping DLL the label path is unreachable unless something writes that byte through a computed pointer, and
318the barrier path is the one that runs.
319
280### 3.4 The object is wider than the public vtable 320### 3.4 The object is wider than the public vtable
281 321
282The inner function at `0x1d7c0` receives the command-list pointer in RDX, copies it to RBX 322The inner function at `0x1d7c0` receives the command-list pointer in RDX, copies it to RBX
283(`0x1d7da`–`0x1d7dd`), and then does more than call public methods: 323(`0x1d7da`–`0x1d7dd`), and then does more than call public methods:
284 324
285- writes 16 bytes at `[rbx+0x544]` (`0x1d803`); 325- writes 32 bytes at `[rbx+0x544]` (`0x1d803`, `0x1d810`: the pipeline object's `+0x10`..`+0x2f`);
286- writes a byte at `[rbx+0x140]` (`0x1d841`, `0x1d884`); 326- writes a byte at `[rbx+0x140]` (`0x1d841`, `0x1d884`);
287- reads `[rbx+0x350]` (`0x1d877`) and `[rbx+0x344]` (`0x1d8c9`); 327- reads `[rbx+0x350]` (`0x1d877`) and `[rbx+0x344]` (`0x1d8c9`);
288- maintains a pointer at `[rbx+0x18]` against limits at `[rbx+0x30]` (`0x1d818`, `0x1d871`); 328- maintains a pointer at `[rbx+0x18]` against limits at `[rbx+0x30]` (`0x1d818`, `0x1d871`);
@@ -291,14 +331,14 @@ The inner function at `0x1d7c0` receives the command-list pointer in RDX, copies
291A client that knows only the public COM interface cannot legally read or write those fields. 331A client that knows only the public COM interface cannot legally read or write those fields.
292The helper is therefore compiled against a **wider contract** than the public vtable: either the 332The helper is therefore compiled against a **wider contract** than the public vtable: either the
293Xbox command-list object is an internal class whose layout first-party code may use, or the game 333Xbox command-list object is an internal class whose layout first-party code may use, or the game
294passes a builder-specific object that also implements the interface. The byte offsets are facts; 334passes a builder-specific object that also implements the interface. Section 3.5a explains most of the fields
295the field meanings and the method at `+0x490` are **Open**. 335(the inline command buffer), and section 3.3 identifies `+0x490` as `Barrier` at console slot 146.
296 336
297This is the most important compatibility finding on this page. A replacement command list that 337This is the most important compatibility finding on this page. A replacement command list that
298implements only the public GCL7/GCL8 vtable is **not** safe to hand to `XboxBvhBuilder`'s build path. (Section 3.5a 338implements only the public GCL7/GCL8 vtable is **not** safe to hand to `XboxBvhBuilder`'s build path. (Section 3.5a
299shows it is not safe for console-compiled callers' public calls either: the console list order differs from the PC 339shows it is not safe for console-compiled callers' public calls either: the console list order differs from the PC
300order past slot 26.) The helper will touch fields the public 340order past slot 26.) The helper will touch fields the public
301object does not define and call `+0x490`, which a public-only vtable does not have. 341object does not define and call `+0x490` (console slot 146, `Barrier`), which a public-only vtable does not have.
302 342
303### 3.5a The FSR DLL as a second device client 343### 3.5a The FSR DLL as a second device client
304 344
@@ -312,7 +352,15 @@ run's command-list calls are the same 13, in the same order, on an RTX 2000 Ada
312**Device.** At context creation it calls slots 14, 15, 18, 19, 27, 38 and 76 and heap slot 9, all with the shapes the 352**Device.** At context creation it calls slots 14, 15, 18, 19, 27, 38 and 76 and heap slot 9, all with the shapes the
313PC order and the measured overrides predict; slot 76 takes the seven `CreateCommittedResource` arguments. During 353PC order and the measured overrides predict; slot 76 takes the seven `CreateCommittedResource` arguments. During
314`ffxDispatch` it adds 16 `CreateRootSignature` and heap slot 10 (the recorder also has a path that calls 24 354`ffxDispatch` it adds 16 `CreateRootSignature` and heap slot 10 (the recorder also has a path that calls 24
315`CopyDescriptorsSimple`, not taken in this run), plus its two compute-pipeline paths: 355`CopyDescriptorsSimple`, not taken in this run), plus its two compute-pipeline paths below.
356
357Which descriptor-copy path runs is decided by a **byte at `+0x18` of the device object**, read before each copy at
358`0x5bb8`, `0x5dd1`, `0x5f8c` and `0x617e`. When it is 0 (the run), the DLL copies the 32 bytes at the source CPU
359handle to the destination CPU handle itself (two 16-byte moves, e.g. `0x5bc0`–`0x5bce`), so CPU descriptor handles
360must be pointers to at least 32 writable bytes. When it is set, the same copy is device slot 24,
361`CopyDescriptorsSimple(1, dst, src, 0)` (calls at `0x5bed`, `0x5e06`, `0x5fc2`, `0x61b3`). A device proxy that sets
362that byte therefore sees this DLL's descriptor copies as calls. Like the list's fields (below), the byte is past the
363vtable pointer of a public object.
316 364
317- **Slot 67** (call at `0x56d9`) is **not** the PC `CreateProtectedResourceSession1`: it takes `(desc, riid, out)` 365- **Slot 67** (call at `0x56d9`) is **not** the PC `CreateProtectedResourceSession1`: it takes `(desc, riid, out)`
318 with `IID_ID3D12PipelineState` and a console-only desc: the root signature at `+0x00`, two pointers into the DLL 366 with `IID_ID3D12PipelineState` and a console-only desc: the root signature at `+0x00`, two pointers into the DLL
@@ -323,6 +371,16 @@ PC order and the measured overrides predict; slot 76 takes the seven `CreateComm
323 runtime refuses the DLL's code (`E_FAIL`): it is not a PC shader. The DLL's pipeline function then returns 371 runtime refuses the DLL's code (`E_FAIL`): it is not a PC shader. The DLL's pipeline function then returns
324 `0x8000000d` (`0x4b85`), but the dispatch goes on, records the null pipeline and faults (`0x65ff`), which is where a 372 `0x8000000d` (`0x4b85`), but the dispatch goes on, records the null pipeline and faults (`0x65ff`), which is where a
325 PC device stops. 373 PC device stops.
374- **Pipeline slot 11 sizes the compute scratch.** After either path succeeds (slot 67 jumps to `0x5833`), the DLL
375 calls the new pipeline's slot 11 as `(0, 0, &obj)` (`0x586d`); the public `ID3D12PipelineState` ends at slot 8, so
376 this is a console-only method. On success it reads a dword through `obj`'s slot 3 (`0x5881`), multiplies it by
377 1024 (`shl ecx, 0xa`), stores it in the pipeline's record at `+0x44` and releases `obj` (slot 2). The context keeps
378 the largest value (`+0x10f8`). Before a dispatch whose pipeline has a non-zero value (`0x64d3`; zero skips the
379 binding), the DLL creates the scratch buffer once, `largest * 0xd0` bytes rounded up to 64 KiB, through device
380 slot 27 in state `UNORDERED_ACCESS` (`0x65ab`), names it `FFX_XBox_ComputeScratch`, and binds it with list slot
381 141 `(2, GPU VA, buffer size, this pipeline's value)` (`0x65f8`). Measured: the calls and the arithmetic. Open:
382 what the slot-11 object is, the unit of its dword (the factor 1024 suggests KiB), the meaning of `0xd0`, and
383 of the leading `2`.
326- The DLL's 29 shaders are `DXBC` containers with `SFI0`, `ISG1`, `OSG1`, `PSV0`, `RTS0`, `HASH` and `ACCC` parts 384- The DLL's 29 shaders are `DXBC` containers with `SFI0`, `ISG1`, `OSG1`, `PSV0`, `RTS0`, `HASH` and `ACCC` parts
327 and no `DXIL`. The `ACCC` payload starts with the tag `FSPX` in all 29; the game's own native shaders are `FSSM` 385 and no `DXIL`. The `ACCC` payload starts with the tag `FSPX` in all 29; the game's own native shaders are `FSSM`
328 inside `XBCH` ([design.md](design.md)). What `FSPX` holds, and whether the existing unpacker and translator can 386 inside `XBCH` ([design.md](design.md)). What `FSPX` holds, and whether the existing unpacker and translator can
@@ -339,18 +397,21 @@ shape and the shift around them, but the shape alone does not single the method
339| 25 (`+0xc8`) | 25 | `SetPipelineState` | `(pipeline)` at `0x59a0` | 397| 25 (`+0xc8`) | 25 | `SetPipelineState` | `(pipeline)` at `0x59a0` |
340| 26 (`+0xd0`) | 26 | `ResourceBarrier` | run: `(1, barriers)`; the BVH builder's `+0xd0` | 398| 26 (`+0xd0`) | 26 | `ResourceBarrier` | run: `(1, barriers)`; the BVH builder's `+0xd0` |
341| 32 (`+0x100`) | **28** | `SetDescriptorHeaps` | run: `(1, &heap)`, the heap a device-proxy descriptor heap | 399| 32 (`+0x100`) | **28** | `SetDescriptorHeaps` | run: `(1, &heap)`, the heap a device-proxy descriptor heap |
342| 33 (`+0x108`) | **29** | `SetComputeRootSignature` (inferred) | one pointer argument, the first call at `0x59a0` (null in the run, where pipeline creation had failed) | 400| 33 (`+0x108`) | **29** | `SetComputeRootSignature` | one pointer argument, the first call at `0x59a0` (null in the run, where pipeline creation had failed); in the BVH builder the pointer stored next to the pipeline (section 3.3) |
343| 35 (`+0x118`) | **31** | `SetComputeRootDescriptorTable` | `(index, heap GPU start + offset)` at `0x59a0` | 401| 35 (`+0x118`) | **31** | `SetComputeRootDescriptorTable` | `(index, heap GPU start + offset)` at `0x59a0` |
344| 41 (`+0x148`) | **37** | `SetComputeRootConstantBufferView` (inferred) | `(index, 64-bit GPU VA from the constant allocator)` at `0x6738`; the root SRV/UAV setters take the same shape | 402| 41 (`+0x148`) | **37** | `SetComputeRootConstantBufferView` (inferred) | `(index, 64-bit GPU VA from the constant allocator)` at `0x6738`; the root SRV/UAV setters take the same shape |
345| 53 (`+0x1a8`) | **49** | `ClearUnorderedAccessViewUint` | run: `(GPU handle, CPU handle, resource, …)` | 403| 53 (`+0x1a8`) | **49** | `ClearUnorderedAccessViewUint` | run: `(GPU handle, CPU handle, resource, …)` |
404| 54 (`+0x1b0`) | **50** | `ClearUnorderedAccessViewFloat` | `(GPU handle, CPU handle, resource, values, 0, null)` at `0x7296`; chosen over the slot-53 call at `0x72ee` by a compare of a local with `0x12` (`0x7266`), with the four values passed in place where the 53 path copies them to the stack |
405| 55 (`+0x1b8`) | **51** | `DiscardResource` | `(resource, null)` at `0x6dcb`, after the pending barriers are flushed through slot 26 |
406| 59 (`+0x1d8`) | — | console only (shape) | four calls, two shapes: `(1, blob, size)` at `0x6b5a` and `0x6d53`, the blob a run of qwords whose first is `0xf3080 \| (qword count & 0x7f)`; and `(0, &qword, 8)` with the qword 1 at `0x6e52` and `0x6eb8`, only when a profiling bit of the context is set (`0x6e2a`). The first argument is set as a byte (`mov dl, 1` / `xor edx, edx`). It looks like one slot for both ends of a GPU event; no public method takes a bool first. With 55 at +4 and 61 at +2, the two slots the console lacks are among 56–60 |
346| 61 (`+0x1e8`) | **59** | `ExecuteIndirect` | `(signature, 1, argument buffer, offset, null, 0)` at `0x59a0` | 407| 61 (`+0x1e8`) | **59** | `ExecuteIndirect` | `(signature, 1, argument buffer, offset, null, 0)` at `0x59a0` |
347| 85 (`+0x2a8`) | — | console only | run: `(stack pointer, 0, 0)`, twice per dispatch | 408| 85 (`+0x2a8`) | — | `CopyTextureRegion` shape (inferred) | run: `(stack pointer, 0, 0)`, twice per dispatch. Statically six arguments, `(&dst, 0, 0, 0, &src, null)`: the public `CopyTextureRegion` (PC 16) with two `D3D12_TEXTURE_COPY_LOCATION`s, not one pointer. At `0x7147` dst is `{texture, SUBRESOURCE_INDEX, 0}` and src `{buffer, PLACED_FOOTPRINT, footprint}`, the footprint from device slot 38 (`GetCopyableFootprints`, `0x708b`); at `0x7191` both are subresource 0 (texture to texture). The caller also clears the next stack argument (`0x70e7`); whether the method takes a seventh is open, as is what console slot 16 is |
348| 141 (`+0x468`) | — | console only | `(2, GPU VA, size, n)` at `0x65f8`: binds a buffer the DLL names `FFX_XBox_ComputeScratch` | 409| 141 (`+0x468`) | — | console only | `(2, GPU VA, size, n)` at `0x65f8`: binds a buffer the DLL names `FFX_XBox_ComputeScratch`; `n` is the bound pipeline's scratch value from pipeline slot 11 (see above) |
349 410
350So the console list has four more methods than the PC list between `ResourceBarrier` (26) and `SetDescriptorHeaps` 411So the console list has four more methods than the PC list between `ResourceBarrier` (26) and `SetDescriptorHeaps`
351(console 32), and two fewer between `ClearUnorderedAccessViewUint` (console 53) and `ExecuteIndirect` (console 61). 412(console 32), and two fewer between `ClearUnorderedAccessViewUint` (console 53) and `ExecuteIndirect` (console 61).
352Mapping the console list as "PC plus a constant" is wrong. The BVH builder's `+0x490` (slot 146) is also past the 413Mapping the console list as "PC plus a constant" is wrong. The BVH builder adds 37, 39, 43 and 45 (the rest of the
353end of the PC list, like 141. 414+4 root group) and the console-only 71, 73, 80, 146 (`Barrier`) and 148 (sections 3.3 and 3.3a).
354 415
355**The list object is wider than its vtable, and this is what that width is for.** Before a root-argument or dispatch 416**The list object is wider than its vtable, and this is what that width is for.** Before a root-argument or dispatch
356call the DLL checks a write cursor at `+0x18` against a limit (`+0x30` for root arguments, `+0x28` for a dispatch). While there is room, 417call the DLL checks a write cursor at `+0x18` against a limit (`+0x30` for root arguments, `+0x28` for a dispatch). While there is room,
@@ -434,7 +495,7 @@ Even taking both projects at face value, the following remain **Open**:
434 `CreateFence`; 495 `CreateFence`;
435- the Xbox queue vtable beyond the public chain (`PresentX`, `SuspendX`, `ResumeX`); 496- the Xbox queue vtable beyond the public chain (`PresentX`, `SuspendX`, `ResumeX`);
436- the `PresentX` signature, plane struct, resource/view arrays and swapchain parameters; 497- the `PresentX` signature, plane struct, resource/view arrays and swapchain parameters;
437- the command-list extension slots (only `0x490` is measured here, without a name); 498- the command-list extension slots other than the ones sections 3.3a and 3.5a measured (71, 73, 80, 85, 141, 146, 148);
438- the DMA list type's real numeric value and the compute/copy console list IIDs; 499- the DMA list type's real numeric value and the compute/copy console list IIDs;
439- any Xbox-specific return convention on these interfaces. 500- any Xbox-specific return convention on these interfaces.
440 501
@@ -525,8 +586,7 @@ command object.
525| `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. | 586| `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. |
526| `SuspendX` / `ResumeX` | No slot or signature. | 587| `SuspendX` / `ResumeX` | No slot or signature. |
527| Xbox queue/list/fence/allocator slot deviations | No runtime binary and no game executable; the package has no queue, fence or allocator client, and its only command-list client is the BVH builder. | 588| Xbox queue/list/fence/allocator slot deviations | No runtime binary and no game executable; the package has no queue, fence or allocator client, and its only command-list client is the BVH builder. |
528| Command-list method at `+0x490` | Offset measured; identity, signature and whether it is an appended COM method or an internal class method are unknown. | 589| Builder's list field `+0x350` | Read once (`0x1d877`) and not explained by the inline buffer of section 3.5a, which covers `+0x18`, `+0x28`, `+0x30`, `+0x140`, `+0x141`, `+0x344` and `+0x544`. |
529| Builder's internal field layout (`+0x18`, `+0x30`, `+0x140`, `+0x344`, `+0x350`, `+0x544`) | No header or symbol; the helper's writes prove the contract is wider than the public vtable, but not what the fields mean. |
530| DMA list use/value | The IID is prior art; type 6 is derived; no shipped module uses it. | 590| DMA list use/value | The IID is prior art; type 6 is derived; no shipped module uses it. |
531 591
532### 5.4 GCL8 (resolved in PR #164) 592### 5.4 GCL8 (resolved in PR #164)
@@ -535,8 +595,8 @@ The shipped builder's rehydrate exports name `ID3D12GraphicsCommandList8`, and
535`OMSetFrontAndBackStencilRef` is public GCL8 at slot 81. **PR #164 adds the public GCL8 interface** 595`OMSetFrontAndBackStencilRef` is public GCL8 at slot 81. **PR #164 adds the public GCL8 interface**
536to `runtime/shims/d3d12_com.cpp`: it records the front/back values, resets them in `Reset`, answers 596to `runtime/shims/d3d12_com.cpp`: it records the front/back values, resets them in `Reset`, answers
537`IID_ID3D12GraphicsCommandList8`, and registers the `d3d12_gcl8` CTest (9/9). The values are recorded 597`IID_ID3D12GraphicsCommandList8`, and registers the `d3d12_gcl8` CTest (9/9). The values are recorded
538but not applied because this layer still has no pipeline/draw path. It does **not** close the 598but not applied because this layer still has no pipeline/draw path. The builder's `+0x490` call is the
539builder's `+0x490` gap, but a GCL8 pointer is now served instead of refused. 599enhanced-barrier `Barrier` at console slot 146 (section 3.3), which a console-order list routes to GCL7 slot 80.
540 600
541## 6. Return conventions 601## 6. Return conventions
542 602
@@ -556,18 +616,18 @@ return has been measured.
556The executable is absent, so the next step should use the one shipped client that exists rather 616The executable is absent, so the next step should use the one shipped client that exists rather
557than invent slots. 617than invent slots.
558 618
5591. **Trace the builder's command-list calls with a logging proxy.** Create a test-only command 6191. **Confirm sections 3.3 and 3.3a with a logging proxy.** Create a test-only command
560 list whose public GCL6/GCL8 vtable logs `(slot, raw arguments)` and whose tail is a page of 620 list whose public GCL6/GCL8 vtable logs `(slot, raw arguments)` and whose tail is a page of
561 logged unknown slots. Pass it to 621 logged unknown slots. Pass it to
562 `XboxBvhBuilder::BuildRaytracingAccelerationStructureBatched2X` with a minimal non-empty 622 `XboxBvhBuilder::BuildRaytracingAccelerationStructureBatched2X` with a minimal non-empty
563 descriptor. The `+0xd0` barrier and `+0x70` dispatch should be observed first; the `+0x490` 623 descriptor. The `+0xd0` barrier and `+0x70` dispatch should be observed first; the `+0x490`
564 call will be recorded with its raw arguments. This turns `0x490` from an offset into a 624 call should arrive with one global UAV barrier group (section 3.3), and slot 148 should be
565 call shape and tests the "wider than the public vtable" hypothesis without a GPU. If the 625 asked for `count * 40` bytes. Keep the cursor at its limit so every call reaches the vtable. If the
566 builder validates its inputs before reaching the dispatch, use a descriptor shaped like the 626 builder validates its inputs before reaching the dispatch, use a descriptor shaped like the
567 one its own `GetRaytracingAccelerationStructurePrebuildInfo` accepts (prior art measured a 627 one its own `GetRaytracingAccelerationStructurePrebuildInfo` accepts (prior art measured a
568 3,000-vertex triangle geometry; the prebuild answer is 204,800 bytes / 128,704 scratch). 628 3,000-vertex triangle geometry; the prebuild answer is 204,800 bytes / 128,704 scratch).
5692. **GCL8 is now implemented** in PR #164 (public slot 81, recorded/reset, CTest 9/9); the 6292. **GCL8 is now implemented** in PR #164 (public slot 81, recorded/reset, CTest 9/9); the
570 remaining builder gap is the `+0x490` method. 630 builder's `+0x490` is `Barrier` (section 3.3), and its slot 148 needs an upload allocator (section 3.3a).
5713. **When the executable appears, trace the four creation calls first.** Per-slot counters on 6313. **When the executable appears, trace the four creation calls first.** Per-slot counters on
572 device slots 8/9/12/36, then queue slots 10/14/15, fence slots 8/9/10, and every slot beyond 632 device slots 8/9/12/36, then queue slots 10/14/15, fence slots 8/9/10, and every slot beyond
573 the public chain. The first `PresentX` call and the queue vtable tail are the only way to 633 the public chain. The first `PresentX` call and the queue vtable tail are the only way to
@@ -609,7 +669,10 @@ the SDK; the console GUIDs are attributed to SCARAB in
609- Builder call sites: Capstone 5.0.7 x86-64 disassembly of the 12 exported functions and the 669- Builder call sites: Capstone 5.0.7 x86-64 disassembly of the 12 exported functions and the
610 functions they call directly; RVAs are PE relative virtual addresses. The 670 functions they call directly; RVAs are PE relative virtual addresses. The
611 `0xd0` call is in the batched entry (`0x216a0`, site `0x2171e`); the `0x490` call is in the 671 `0xd0` call is in the batched entry (`0x216a0`, site `0x2171e`); the `0x490` call is in the
612 per-descriptor function reached from it (`0x1d7c0`, site `0x1da02`). 672 per-descriptor function reached from it (`0x1d7c0`, site `0x1da02`). Section 3.3a: the
673 `call [reg+disp]` sites in the rest of `.text` whose object register holds the list pointer,
674 each read with the argument registers set before it and the inline write it falls back from;
675 the barrier constant is the 16 bytes at RVA `0xcdf60` (file offset from the section table).
613- Public slots: parse the `MIDL_INTERFACE`/`virtual` declarations in `d3d12.h`; the counts in 676- Public slots: parse the `MIDL_INTERFACE`/`virtual` declarations in `d3d12.h`; the counts in
614 section 2 include the seven `IUnknown`+`ID3D12Object` slots. Cross-check selected values with 677 section 2 include the seven `IUnknown`+`ID3D12Object` slots. Cross-check selected values with
615 `python tools/d3d12_xs_surface.py --check --sdk` (116 slots, 83 standard GUIDs) and 678 `python tools/d3d12_xs_surface.py --check --sdk` (116 slots, 83 standard GUIDs) and