diff options
| author | CLHelper <359823989+CLHelper@users.noreply.github.com> | 2026-11-22 11:08:48 +0000 |
|---|---|---|
| committer | CLHelper <359823989+CLHelper@users.noreply.github.com> | 2026-11-22 11:08:48 +0000 |
| commit | a3460331ffc83567cc202e7b9eb20d4bc87e8340 (patch) | |
| tree | 57032679be1307a5645c6c3642aeed2f7022ffac /docs/d3d12_command_objects.md | |
| parent | f85582e23d4ab9e19acbf694358f137d6b8531b1 (diff) | |
docs: builder command-list slots in console order; +0x490 is Barrier (slot 146)
Re-read the BVH builder's command-list call sites in the console order of section 3.5a:
+0x108 is SetComputeRootSignature, +0x138 SetComputeRoot32BitConstants and +0x168
SetComputeRootUnorderedAccessView (the PC-order readings SetComputeRoot32BitConstant,
SetComputeRootShaderResourceView and SOSetTargets do not fit the argument registers or the
inline writes). RDX at the +0xc8 call is the pipeline. +0x490 (console slot 146) is the
public enhanced Barrier with one global compute-to-compute UAV barrier.
New section 3.3a: slots 37/39/43/45 at other sites, 148 (upload allocator whose pointer is
used as the GPU address), 80 (dispatch with an extra word), 71/73 (label write/wait,
unreachable in the shipping DLL) and the second Barrier site.
Diffstat (limited to 'docs/d3d12_command_objects.md')
| -rw-r--r-- | docs/d3d12_command_objects.md | 102 |
1 files changed, 72 insertions, 30 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md index 8dd9fcadb..3a8c1435a 100644 --- a/docs/d3d12_command_objects.md +++ b/docs/d3d12_command_objects.md | |||
| @@ -254,21 +254,28 @@ batched paths. | |||
| 254 | Disassembling the exported bodies and the functions they call directly gives these calls through | 254 | Disassembling the exported bodies and the functions they call directly gives these calls through |
| 255 | the object received in the command-list parameter: | 255 | the object received in the command-list parameter: |
| 256 | 256 | ||
| 257 | | RVA | Vtable offset | Public slot if PC order | Observed arguments | Confidence | | 257 | The console list is not in PC order past slot 26 (section 3.5a), so the method column reads each call in the |
| 258 | |---:|---:|---:|---|---| | 258 | console 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` | | 259 | paragraph). 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 | ||
| 267 | The `+0x490` call is after the `Dispatch(1,1,1)` at `0x1d9cb`, in the per-descriptor path. It is | 272 | The `+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 |
| 269 | the public chain. It is either an appended console command-list method or a method of an internal | 274 | call: one `D3D12_BARRIER_GROUP` of type `D3D12_BARRIER_TYPE_GLOBAL` (0) holding one `D3D12_GLOBAL_BARRIER` with |
| 270 | class that the helper receives through the command-list parameter; the evidence below favours the | 275 | `SyncBefore = SyncAfter = D3D12_BARRIER_SYNC_COMPUTE_SHADING` (`0x80`) and |
| 271 | second 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 | ||
| 278 | same constant is `0xd7b4` (section 3.3a). | ||
| 272 | 279 | ||
| 273 | The same two inner functions (`0x1d540` and `0x1d7c0`) contain the `+0x70`, `+0xc8`, `+0x108`, | 280 | The 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 | |||
| 277 | internal functions using objects cached in the builder (`[this+0x10]` and `[this+8]`). Their | 284 | internal functions using objects cached in the builder (`[this+0x10]` and `[this+8]`). Their |
| 278 | signatures still require GCL4/GCL8 objects, but those bodies do not measure command-list slots. | 285 | signatures 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 | |||
| 289 | The rest of `.text` has further calls through the list pointer. Each name below rests on the call shape; "inline" | ||
| 290 | means 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 | |||
| 305 | So the compute root-binding group keeps its PC order four slots later (33, 37, 39, 43 and 45 here; 35 and 41 in | ||
| 306 | section 3.5a), and the console list has methods well past the PC tail: 71, 73, 80, 146 and 148 here, 141 in the | ||
| 307 | FSR DLL. | ||
| 308 | |||
| 309 | Slot 148 matters beyond the builder: the address it returns is written by the CPU and passed unchanged to the GPU | ||
| 310 | as a root SRV address, so console upload memory has the same address for the CPU and the GPU. A replacement must | ||
| 311 | return 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 | |||
| 314 | The function at `0xd580` uses the 71/73 pair instead of the slot-146 barrier when the byte at RVA `0xd773c` is set. | ||
| 315 | That 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 | ||
| 317 | the shipping DLL the label path is unreachable unless something writes that byte through a computed pointer, and | ||
| 318 | the 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 | ||
| 282 | The inner function at `0x1d7c0` receives the command-list pointer in RDX, copies it to RBX | 322 | The 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 | |||
| 291 | A client that knows only the public COM interface cannot legally read or write those fields. | 331 | A client that knows only the public COM interface cannot legally read or write those fields. |
| 292 | The helper is therefore compiled against a **wider contract** than the public vtable: either the | 332 | The helper is therefore compiled against a **wider contract** than the public vtable: either the |
| 293 | Xbox command-list object is an internal class whose layout first-party code may use, or the game | 333 | Xbox command-list object is an internal class whose layout first-party code may use, or the game |
| 294 | passes a builder-specific object that also implements the interface. The byte offsets are facts; | 334 | passes a builder-specific object that also implements the interface. Section 3.5a explains most of the fields |
| 295 | the 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 | ||
| 297 | This is the most important compatibility finding on this page. A replacement command list that | 337 | This is the most important compatibility finding on this page. A replacement command list that |
| 298 | implements only the public GCL7/GCL8 vtable is **not** safe to hand to `XboxBvhBuilder`'s build path. (Section 3.5a | 338 | implements only the public GCL7/GCL8 vtable is **not** safe to hand to `XboxBvhBuilder`'s build path. (Section 3.5a |
| 299 | shows it is not safe for console-compiled callers' public calls either: the console list order differs from the PC | 339 | shows it is not safe for console-compiled callers' public calls either: the console list order differs from the PC |
| 300 | order past slot 26.) The helper will touch fields the public | 340 | order past slot 26.) The helper will touch fields the public |
| 301 | object does not define and call `+0x490`, which a public-only vtable does not have. | 341 | object 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 | ||
| @@ -339,7 +379,7 @@ shape and the shift around them, but the shape alone does not single the method | |||
| 339 | | 25 (`+0xc8`) | 25 | `SetPipelineState` | `(pipeline)` at `0x59a0` | | 379 | | 25 (`+0xc8`) | 25 | `SetPipelineState` | `(pipeline)` at `0x59a0` | |
| 340 | | 26 (`+0xd0`) | 26 | `ResourceBarrier` | run: `(1, barriers)`; the BVH builder's `+0xd0` | | 380 | | 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 | | 381 | | 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) | | 382 | | 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` | | 383 | | 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 | | 384 | | 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, …)` | | 385 | | 53 (`+0x1a8`) | **49** | `ClearUnorderedAccessViewUint` | run: `(GPU handle, CPU handle, resource, …)` | |
| @@ -349,8 +389,8 @@ shape and the shift around them, but the shape alone does not single the method | |||
| 349 | 389 | ||
| 350 | So the console list has four more methods than the PC list between `ResourceBarrier` (26) and `SetDescriptorHeaps` | 390 | So 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). | 391 | (console 32), and two fewer between `ClearUnorderedAccessViewUint` (console 53) and `ExecuteIndirect` (console 61). |
| 352 | Mapping the console list as "PC plus a constant" is wrong. The BVH builder's `+0x490` (slot 146) is also past the | 392 | Mapping the console list as "PC plus a constant" is wrong. The BVH builder adds 37, 39, 43 and 45 (the rest of the |
| 353 | end of the PC list, like 141. | 393 | +4 root group) and the console-only 71, 73, 80, 146 (`Barrier`) and 148 (sections 3.3 and 3.3a). |
| 354 | 394 | ||
| 355 | **The list object is wider than its vtable, and this is what that width is for.** Before a root-argument or dispatch | 395 | **The list object is wider than its vtable, and this is what that width is for.** Before a root-argument or dispatch |
| 356 | call the DLL checks a write cursor at `+0x18` against a limit (`+0x30` for root arguments, `+0x28` for a dispatch). While there is room, | 396 | call 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 +474,7 @@ Even taking both projects at face value, the following remain **Open**: | |||
| 434 | `CreateFence`; | 474 | `CreateFence`; |
| 435 | - the Xbox queue vtable beyond the public chain (`PresentX`, `SuspendX`, `ResumeX`); | 475 | - the Xbox queue vtable beyond the public chain (`PresentX`, `SuspendX`, `ResumeX`); |
| 436 | - the `PresentX` signature, plane struct, resource/view arrays and swapchain parameters; | 476 | - 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); | 477 | - 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; | 478 | - the DMA list type's real numeric value and the compute/copy console list IIDs; |
| 439 | - any Xbox-specific return convention on these interfaces. | 479 | - any Xbox-specific return convention on these interfaces. |
| 440 | 480 | ||
| @@ -485,8 +525,7 @@ command object. | |||
| 485 | | `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. | | 525 | | `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. | |
| 486 | | `SuspendX` / `ResumeX` | No slot or signature. | | 526 | | `SuspendX` / `ResumeX` | No slot or signature. | |
| 487 | | 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. | | 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. | |
| 488 | | Command-list method at `+0x490` | Offset measured; identity, signature and whether it is an appended COM method or an internal class method are unknown. | | 528 | | 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`. | |
| 489 | | 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. | | ||
| 490 | | DMA list use/value | The IID is prior art; type 6 is derived; no shipped module uses it. | | 529 | | DMA list use/value | The IID is prior art; type 6 is derived; no shipped module uses it. | |
| 491 | 530 | ||
| 492 | ### 5.4 GCL8 (resolved in PR #164) | 531 | ### 5.4 GCL8 (resolved in PR #164) |
| @@ -495,8 +534,8 @@ The shipped builder's rehydrate exports name `ID3D12GraphicsCommandList8`, and | |||
| 495 | `OMSetFrontAndBackStencilRef` is public GCL8 at slot 81. **PR #164 adds the public GCL8 interface** | 534 | `OMSetFrontAndBackStencilRef` is public GCL8 at slot 81. **PR #164 adds the public GCL8 interface** |
| 496 | to `runtime/shims/d3d12_com.cpp`: it records the front/back values, resets them in `Reset`, answers | 535 | to `runtime/shims/d3d12_com.cpp`: it records the front/back values, resets them in `Reset`, answers |
| 497 | `IID_ID3D12GraphicsCommandList8`, and registers the `d3d12_gcl8` CTest (9/9). The values are recorded | 536 | `IID_ID3D12GraphicsCommandList8`, and registers the `d3d12_gcl8` CTest (9/9). The values are recorded |
| 498 | but not applied because this layer still has no pipeline/draw path. It does **not** close the | 537 | but not applied because this layer still has no pipeline/draw path. The builder's `+0x490` call is the |
| 499 | builder's `+0x490` gap, but a GCL8 pointer is now served instead of refused. | 538 | enhanced-barrier `Barrier` at console slot 146 (section 3.3), which a console-order list routes to GCL7 slot 80. |
| 500 | 539 | ||
| 501 | ## 6. Return conventions | 540 | ## 6. Return conventions |
| 502 | 541 | ||
| @@ -516,18 +555,18 @@ return has been measured. | |||
| 516 | The executable is absent, so the next step should use the one shipped client that exists rather | 555 | The executable is absent, so the next step should use the one shipped client that exists rather |
| 517 | than invent slots. | 556 | than invent slots. |
| 518 | 557 | ||
| 519 | 1. **Trace the builder's command-list calls with a logging proxy.** Create a test-only command | 558 | 1. **Confirm sections 3.3 and 3.3a with a logging proxy.** Create a test-only command |
| 520 | list whose public GCL6/GCL8 vtable logs `(slot, raw arguments)` and whose tail is a page of | 559 | list whose public GCL6/GCL8 vtable logs `(slot, raw arguments)` and whose tail is a page of |
| 521 | logged unknown slots. Pass it to | 560 | logged unknown slots. Pass it to |
| 522 | `XboxBvhBuilder::BuildRaytracingAccelerationStructureBatched2X` with a minimal non-empty | 561 | `XboxBvhBuilder::BuildRaytracingAccelerationStructureBatched2X` with a minimal non-empty |
| 523 | descriptor. The `+0xd0` barrier and `+0x70` dispatch should be observed first; the `+0x490` | 562 | descriptor. The `+0xd0` barrier and `+0x70` dispatch should be observed first; the `+0x490` |
| 524 | call will be recorded with its raw arguments. This turns `0x490` from an offset into a | 563 | call should arrive with one global UAV barrier group (section 3.3), and slot 148 should be |
| 525 | call shape and tests the "wider than the public vtable" hypothesis without a GPU. If the | 564 | asked for `count * 40` bytes. Keep the cursor at its limit so every call reaches the vtable. If the |
| 526 | builder validates its inputs before reaching the dispatch, use a descriptor shaped like the | 565 | builder validates its inputs before reaching the dispatch, use a descriptor shaped like the |
| 527 | one its own `GetRaytracingAccelerationStructurePrebuildInfo` accepts (prior art measured a | 566 | one its own `GetRaytracingAccelerationStructurePrebuildInfo` accepts (prior art measured a |
| 528 | 3,000-vertex triangle geometry; the prebuild answer is 204,800 bytes / 128,704 scratch). | 567 | 3,000-vertex triangle geometry; the prebuild answer is 204,800 bytes / 128,704 scratch). |
| 529 | 2. **GCL8 is now implemented** in PR #164 (public slot 81, recorded/reset, CTest 9/9); the | 568 | 2. **GCL8 is now implemented** in PR #164 (public slot 81, recorded/reset, CTest 9/9); the |
| 530 | remaining builder gap is the `+0x490` method. | 569 | builder's `+0x490` is `Barrier` (section 3.3), and its slot 148 needs an upload allocator (section 3.3a). |
| 531 | 3. **When the executable appears, trace the four creation calls first.** Per-slot counters on | 570 | 3. **When the executable appears, trace the four creation calls first.** Per-slot counters on |
| 532 | device slots 8/9/12/36, then queue slots 10/14/15, fence slots 8/9/10, and every slot beyond | 571 | device slots 8/9/12/36, then queue slots 10/14/15, fence slots 8/9/10, and every slot beyond |
| 533 | the public chain. The first `PresentX` call and the queue vtable tail are the only way to | 572 | the public chain. The first `PresentX` call and the queue vtable tail are the only way to |
| @@ -567,7 +606,10 @@ the SDK; the console GUIDs are attributed to SCARAB in | |||
| 567 | - Builder call sites: Capstone 5.0.7 x86-64 disassembly of the 12 exported functions and the | 606 | - Builder call sites: Capstone 5.0.7 x86-64 disassembly of the 12 exported functions and the |
| 568 | functions they call directly; RVAs are PE relative virtual addresses. The | 607 | functions they call directly; RVAs are PE relative virtual addresses. The |
| 569 | `0xd0` call is in the batched entry (`0x216a0`, site `0x2171e`); the `0x490` call is in the | 608 | `0xd0` call is in the batched entry (`0x216a0`, site `0x2171e`); the `0x490` call is in the |
| 570 | per-descriptor function reached from it (`0x1d7c0`, site `0x1da02`). | 609 | per-descriptor function reached from it (`0x1d7c0`, site `0x1da02`). Section 3.3a: the |
| 610 | `call [reg+disp]` sites in the rest of `.text` whose object register holds the list pointer, | ||
| 611 | each read with the argument registers set before it and the inline write it falls back from; | ||
| 612 | the barrier constant is the 16 bytes at RVA `0xcdf60` (file offset from the section table). | ||
| 571 | - Public slots: parse the `MIDL_INTERFACE`/`virtual` declarations in `d3d12.h`; the counts in | 613 | - Public slots: parse the `MIDL_INTERFACE`/`virtual` declarations in `d3d12.h`; the counts in |
| 572 | section 2 include the seven `IUnknown`+`ID3D12Object` slots. Cross-check selected values with | 614 | section 2 include the seven `IUnknown`+`ID3D12Object` slots. Cross-check selected values with |
| 573 | `python tools/d3d12_xs_surface.py --check --sdk` (116 slots, 83 standard GUIDs) and | 615 | `python tools/d3d12_xs_surface.py --check --sdk` (116 slots, 83 standard GUIDs) and |