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 11:24:15 +0000
committerCLHelper <359823989+CLHelper@users.noreply.github.com>2026-11-22 11:24:15 +0000
commit932287398d961fd7d87fdde4726e99284ba1f659 (patch)
tree7793d839bdb18e9dfba52d57795208f5e5b76ddd /docs/d3d12_command_objects.md
parentf85582e23d4ab9e19acbf694358f137d6b8531b1 (diff)
docs: FSR DLL list slots 54/55/59/85, pipeline slot 11 and the device +0x18 copy switch
Static reading of the FSR DLL's call sites, added to section 3.5a: - 54 is ClearUnorderedAccessViewFloat and 55 DiscardResource (both +4). - 59 is one console slot with a bool first argument, used for both ends of a GPU event; the two slots the console lacks are among 56-60. - 85 takes the six CopyTextureRegion arguments (two copy locations), not one pointer: buffer-to-texture with a footprint from device slot 38, or texture-to-texture. - Pipeline slot 11 (console-only) gives a per-pipeline scratch value; the largest times 0xd0 sizes FFX_XBox_ComputeScratch, and slot 141's fourth argument is the bound pipeline's value. - A byte at device +0x18 selects between the DLL's own 32-byte descriptor copy and device slot 24 CopyDescriptorsSimple. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/d3d12_command_objects.md')
-rw-r--r--docs/d3d12_command_objects.md27
1 files changed, 24 insertions, 3 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md
index 8dd9fcadb..8360b1186 100644
--- a/docs/d3d12_command_objects.md
+++ b/docs/d3d12_command_objects.md
@@ -312,7 +312,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 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
313PC order and the measured overrides predict; slot 76 takes the seven `CreateCommittedResource` arguments. During 313PC 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 314`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: 315`CopyDescriptorsSimple`, not taken in this run), plus its two compute-pipeline paths below.
316
317Which descriptor-copy path runs is decided by a **byte at `+0x18` of the device object**, read before each copy at
318`0x5bb8`, `0x5dd1`, `0x5f8c` and `0x617e`. When it is 0 (the run), the DLL copies the 32 bytes at the source CPU
319handle to the destination CPU handle itself (two 16-byte moves, e.g. `0x5bc0`–`0x5bce`), so CPU descriptor handles
320must be pointers to at least 32 writable bytes. When it is set, the same copy is device slot 24,
321`CopyDescriptorsSimple(1, dst, src, 0)` (calls at `0x5bed`, `0x5e06`, `0x5fc2`, `0x61b3`). A device proxy that sets
322that byte therefore sees this DLL's descriptor copies as calls. Like the list's fields (below), the byte is past the
323vtable pointer of a public object.
316 324
317- **Slot 67** (call at `0x56d9`) is **not** the PC `CreateProtectedResourceSession1`: it takes `(desc, riid, out)` 325- **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 326 with `IID_ID3D12PipelineState` and a console-only desc: the root signature at `+0x00`, two pointers into the DLL
@@ -323,6 +331,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 331 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 332 `0x8000000d` (`0x4b85`), but the dispatch goes on, records the null pipeline and faults (`0x65ff`), which is where a
325 PC device stops. 333 PC device stops.
334- **Pipeline slot 11 sizes the compute scratch.** After either path succeeds (slot 67 jumps to `0x5833`), the DLL
335 calls the new pipeline's slot 11 as `(0, 0, &obj)` (`0x586d`); the public `ID3D12PipelineState` ends at slot 8, so
336 this is a console-only method. On success it reads a dword through `obj`'s slot 3 (`0x5881`), multiplies it by
337 1024 (`shl ecx, 0xa`), stores it in the pipeline's record at `+0x44` and releases `obj` (slot 2). The context keeps
338 the largest value (`+0x10f8`). Before a dispatch whose pipeline has a non-zero value (`0x64d3`; zero skips the
339 binding), the DLL creates the scratch buffer once, `largest * 0xd0` bytes rounded up to 64 KiB, through device
340 slot 27 in state `UNORDERED_ACCESS` (`0x65ab`), names it `FFX_XBox_ComputeScratch`, and binds it with list slot
341 141 `(2, GPU VA, buffer size, this pipeline's value)` (`0x65f8`). Measured: the calls and the arithmetic. Open:
342 what the slot-11 object is, the unit of its dword (the factor 1024 suggests KiB), the meaning of `0xd0`, and
343 of the leading `2`.
326- The DLL's 29 shaders are `DXBC` containers with `SFI0`, `ISG1`, `OSG1`, `PSV0`, `RTS0`, `HASH` and `ACCC` parts 344- 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` 345 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 346 inside `XBCH` ([design.md](design.md)). What `FSPX` holds, and whether the existing unpacker and translator can
@@ -343,9 +361,12 @@ shape and the shift around them, but the shape alone does not single the method
343| 35 (`+0x118`) | **31** | `SetComputeRootDescriptorTable` | `(index, heap GPU start + offset)` at `0x59a0` | 361| 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 | 362| 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, …)` | 363| 53 (`+0x1a8`) | **49** | `ClearUnorderedAccessViewUint` | run: `(GPU handle, CPU handle, resource, …)` |
364| 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 |
365| 55 (`+0x1b8`) | **51** | `DiscardResource` | `(resource, null)` at `0x6dcb`, after the pending barriers are flushed through slot 26 |
366| 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` | 367| 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 | 368| 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` | 369| 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 370
350So the console list has four more methods than the PC list between `ResourceBarrier` (26) and `SetDescriptorHeaps` 371So 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). 372(console 32), and two fewer between `ClearUnorderedAccessViewUint` (console 53) and `ExecuteIndirect` (console 61).