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:
Diffstat (limited to 'docs/d3d12_command_objects.md')
-rw-r--r--docs/d3d12_command_objects.md28
1 files changed, 18 insertions, 10 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md
index 3a346edff..a55c3d964 100644
--- a/docs/d3d12_command_objects.md
+++ b/docs/d3d12_command_objects.md
@@ -274,8 +274,13 @@ The `+0x490` call is after the `Dispatch(1,1,1)` at `0x1d9cb`, in the per-descri
274call: one `D3D12_BARRIER_GROUP` of type `D3D12_BARRIER_TYPE_GLOBAL` (0) holding one `D3D12_GLOBAL_BARRIER` with 274call: one `D3D12_BARRIER_GROUP` of type `D3D12_BARRIER_TYPE_GLOBAL` (0) holding one `D3D12_GLOBAL_BARRIER` with
275`SyncBefore = SyncAfter = D3D12_BARRIER_SYNC_COMPUTE_SHADING` (`0x80`) and 275`SyncBefore = SyncAfter = D3D12_BARRIER_SYNC_COMPUTE_SHADING` (`0x80`) and
276`AccessBefore = AccessAfter = D3D12_BARRIER_ACCESS_UNORDERED_ACCESS` (`0x10`), values as in SDK 10.0.26100 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 277`d3d12.h`. The public PC equivalent is GCL7 slot 80.
278same constant is `0xd7b4` (section 3.3a). 278
279@MoonYueya's static enumeration of the Xbox Series 1.0.2.1 builder found 29 calls through console slot 146
280across seven functions. It counted 11 direct calls through the vtable entry and 18 calls through a register
281loaded from that entry. All 29 passed one global barrier group containing one `D3D12_GLOBAL_BARRIER` with
282the same compute-shading and unordered-access arguments described above. The counts cover the two
283enumerated dispatch forms in the builder's `.text`. [Static corroboration and coverage details](https://github.com/ItsNotRexed/Leonida/issues/1626)
279 284
280The same two inner functions (`0x1d540` and `0x1d7c0`) contain the `+0x70`, `+0xc8`, `+0x108`, 285The same two inner functions (`0x1d540` and `0x1d7c0`) contain the `+0x70`, `+0xc8`, `+0x108`,
281`+0x138`, `+0x168` and `+0x490` calls; the outer batched function contains the `+0xd0` barrier. 286`+0x138`, `+0x168` and `+0x490` calls; the outer batched function contains the `+0xd0` barrier.
@@ -286,8 +291,9 @@ signatures still require GCL4/GCL8 objects, but those bodies do not measure comm
286 291
287### 3.3a Other builder call sites past the PC order 292### 3.3a Other builder call sites past the PC order
288 293
289The rest of `.text` has further calls through the list pointer. Each name below rests on the call shape; "inline" 294The rest of `.text` has further calls through the list pointer. The table shows examples, including one of the
290means the call is the fallback of an inline write of the same values. 295slot-146 sites counted in section 3.3. Each name rests on the call shape. “Inline” means the call is the fallback
296of an inline write of the same values.
291 297
292| RVA | Vtable offset | Console slot → PC method | Observed arguments | Confidence | 298| RVA | Vtable offset | Console slot → PC method | Observed arguments | Confidence |
293|---:|---:|---|---|---| 299|---:|---:|---|---|---|
@@ -363,10 +369,11 @@ that byte therefore sees this DLL's descriptor copies as calls. Like the list's
363vtable pointer of a public object. 369vtable pointer of a public object.
364 370
365- **Slot 67** (call at `0x56d9`) is **not** the PC `CreateProtectedResourceSession1`: it takes `(desc, riid, out)` 371- **Slot 67** (call at `0x56d9`) is **not** the PC `CreateProtectedResourceSession1`: it takes `(desc, riid, out)`
366 with `IID_ID3D12PipelineState` and a console-only desc: the root signature at `+0x00`, two pointers into the DLL 372 with `IID_ID3D12PipelineState`. The DLL's own messages name it `DeserializeComputePipelineStateX`. Its desc is the
367 with sizes (`0x1c` and `0x14` bytes here) at `+0x08`..`+0x20`, and a copy of a code blob at `+0x28` with its size 373 root signature at `+0x00`, then pointer and size pairs for the shader's `FSPX` entries: kind 0 at `+0x08`, kind 1
368 at `+0x30` (`0x1080` bytes here; most likely the shader's native code). The proxy used to forward it to the PC 374 at `+0x18`, a copy of the kind-6 program at `+0x28`, and kind 7 at `+0x38` ([fspx.md](fspx.md)). The proxy used to
369 method at the same index; it now refuses it (`E_NOTIMPL`). When it fails, the DLL takes slot 62. 375 forward it to the PC method at the same index; it now refuses it (`E_NOTIMPL`). When it fails, the DLL takes
376 slot 62; its message for that failure calls the fallback "NewBE".
370- **Slot 62** (call at `0x5825`) takes the measured `(D3D12_COMPUTE_PIPELINE_STATE_DESC*, 0, 0, riid, out)`. The PC 377- **Slot 62** (call at `0x5825`) takes the measured `(D3D12_COMPUTE_PIPELINE_STATE_DESC*, 0, 0, riid, out)`. The PC
371 runtime refuses the DLL's code (`E_FAIL`): it is not a PC shader. The DLL's pipeline function then returns 378 runtime refuses the DLL's code (`E_FAIL`): it is not a PC shader. The DLL's pipeline function then returns
372 `0x8000000d` (`0x4b85`), but the dispatch goes on, records the null pipeline and faults (`0x65ff`), which is where a 379 `0x8000000d` (`0x4b85`), but the dispatch goes on, records the null pipeline and faults (`0x65ff`), which is where a
@@ -383,8 +390,9 @@ vtable pointer of a public object.
383 of the leading `2`. 390 of the leading `2`.
384- The DLL's 29 shaders are `DXBC` containers with `SFI0`, `ISG1`, `OSG1`, `PSV0`, `RTS0`, `HASH` and `ACCC` parts 391- The DLL's 29 shaders are `DXBC` containers with `SFI0`, `ISG1`, `OSG1`, `PSV0`, `RTS0`, `HASH` and `ACCC` parts
385 and no `DXIL`. The `ACCC` payload starts with the tag `FSPX` in all 29; the game's own native shaders are `FSSM` 392 and no `DXIL`. The `ACCC` payload starts with the tag `FSPX` in all 29; the game's own native shaders are `FSSM`
386 inside `XBCH` ([design.md](design.md)). What `FSPX` holds, and whether the existing unpacker and translator can 393 inside `XBCH` ([design.md](design.md)). `FSPX` is a directory around an uncompressed RDNA2 program and its
387 take it, is open; running FSR needs that, not the executable. 394 dispatch state; `tools/fspx_unpack.py` unpacks it for the translator, which takes 13 of the 29 today. The 13 that
395 use `v_dot4` instructions are not translated yet ([fspx.md](fspx.md)).
388 396
389**Command list.** The console list is **not** the PC order past `ResourceBarrier`. Each row is backed by the 397**Command list.** The console list is **not** the PC order past `ResourceBarrier`. Each row is backed by the
390argument shape at the call and, where marked "run", by the call seen in the run. Rows marked "inferred" fit the 398argument shape at the call and, where marked "run", by the call seen in the run. Rows marked "inferred" fit the