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:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 21:44:23 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 21:44:23 -0500
commitb8563e949ed389fff20be91c73687a70b5213469 (patch)
treed69c6817854ce0a14a67ff1fd0f1c39dec68a91f /docs/d3d12_command_objects.md
parent00fc23b9a9eeb1a75f1fec2b58024bea15c26663 (diff)
parent7ae1dd3de34f1542242bc8ccfc80d9b97d20cc01 (diff)
Merge main into D3D-448-GRAPHICS (#974)
main already lays graphics root arguments out in the console layout (from s8, one dword per table: #939's graphics-root-layout patch in #984's form, pack_stage(Stage::Pixel), RootArgumentLayout::graphics_console, graphics_arguments_end, LEONIDA_GRAPHICS_STAGE_LAYOUT=0 for pack()). That form stays. What this pull request adds beyond it is carried onto it: the mesh-shader root window (translator, index "root_window", mesh_ok, the two refusals) and its tests. Its own graphics spill handling (Spill::block) and LEONIDA_GRAPHICS_ROOT_LAYOUT=pc are not carried: main keeps pack()'s s0 layout for a graphics signature past s31, and its switch does what =pc did. Conflicts: - runtime/src/root_signature.h, root_signature.cpp: main's pack_stage (compute spill array, spill_dword); the Spill enum, first_spilled and spilled_dwords dropped. The header keeps the PR's evidence note, with Stage::Pixel. - runtime/shims/d3d12_com.h: main's comment and members, with the mesh window described; mesh_ok added (false by default, set only for a console-layout signature that Stage::Mesh also places); the PR's second graphics_console dropped. - runtime/shims/d3d12_vulkan_device.cpp (CreateRootSignature): main's pixel/packed form; the PR's Stage::Mesh pack and its log line added, mesh_ok = pixel.ok && mesh.ok. The mesh-shader refusal without "root_window" (no conflict) stays. - runtime/shims/d3d12_com.cpp: DispatchMesh keeps main's any_nonempty_viewport() and graphics_user_data() after the PR's mesh_ok check; address() keeps main's comment. The PR's kNoSgpr guard in constants()/address() stays, reworded: in main a spilled compute parameter has first_sgpr kNoSgpr, and kNoSgpr + offset wrapped round to s0. - runtime/src/shader_library.h: both (main's wave64_graphics, the PR's root_window). - runtime/test/d3d12_mesh_test.cpp: main's mesh shader-kind byte on both containers (also the PR's ms_old); the PR's two-parameter signature replaces main's 25-dword padding onto the s0 layout; both test blocks kept (the PR's window refusals, main's DISPATCH_MESH command signature), each in its own scope. The =pc case is dropped (main's switch is read once per process). - runtime/CMakeLists.txt (no conflict): the mesh test uses ps_draw.spv again; the ps_draw_s0.spv rule is gone. - runtime/test/glsl/ps_draw.frag, vs_depth.vert, vs_draw.vert, vs_draw_int.vert, ps_depth_write.frag and runtime/test/shaders/ps_m15, ps_m2, ps_m2_array, ps_m2_literal, ps_m2_uoff, ps_m3, ps_m3_post, ps_m3_query, vs_m15, vs_m3 (.asm): main's (the same s8 rewrite done twice); ps_draw.frag's mesh-test note updated. - runtime/test/root_signature_test.cpp (no conflict): the Spill::block cases dropped, the window cases kept. - docs/design.md: main's rows (loop guard, direct resource heap) and the PR's user-data row. - docs/d3d12_vulkan.md (no conflict): section 3.5 and the CreateRootSignature bullet rewritten for main's form. 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.md15
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md
index 5a214e325..1aef12206 100644
--- a/docs/d3d12_command_objects.md
+++ b/docs/d3d12_command_objects.md
@@ -375,9 +375,10 @@ section 3.5a), and the console list has methods well past the PC tail: 71, 73, 8
375FSR DLL. 375FSR DLL.
376 376
377Slot 148 matters beyond the builder: the address it returns is written by the CPU and passed unchanged to the GPU 377Slot 148 matters beyond the builder: the address it returns is written by the CPU and passed unchanged to the GPU
378as a root SRV address, so console upload memory has the same address for the CPU and the GPU. A replacement must 378as a root SRV address, so console upload memory has the same address for the CPU and the GPU. On a PC the two
379return memory whose CPU pointer is also a valid GPU address (for this layer: inside the arena of 379address spaces differ, so `d3d12_xs_device.cpp` carves a bump arena out of persistently-mapped UPLOAD-heap
380[d3d12_vulkan.md §3.3](d3d12_vulkan.md)). 380buffers: the title writes the mapped memory and the six root descriptor setters and the IA/SO view setters
381translate the CPU pointer to the chunk's buffer device address before forwarding.
381 382
382The function at `0xd580` uses the 71/73 pair instead of the slot-146 barrier when the byte at RVA `0xd773c` is set. 383The function at `0xd580` uses the 71/73 pair instead of the slot-146 barrier when the byte at RVA `0xd773c` is set.
383That byte is one of seven bools at `0xd7738`–`0xd773e` in zero-initialised `.bss`. The only accesses to them in 384That byte is one of seven bools at `0xd7738`–`0xd773e` in zero-initialised `.bss`. The only accesses to them in
@@ -764,6 +765,12 @@ Queues and fences are wrapped the same way.
764 object implements but the proxy does not model is logged once and refused. 765 object implements but the proxy does not model is logged once and refused.
765- **The refused tail.** A slot past the public chain, up to the end of the proxy's own table (128 queue and 766- **The refused tail.** A slot past the public chain, up to the end of the proxy's own table (128 queue and
766 64 fence slots, every one a thunk), logs its first four argument words once and returns `E_NOTIMPL`. 767 64 fence slots, every one a thunk), logs its first four argument words once and returns `E_NOTIMPL`.
768- **Fence slot 12.** The one served slot past the chain. The retail executable calls it as
769 `(value, descriptor, flags)` and reads the return as a pointer to the fence's 64-bit completed value: it
770 compares that value with `~0` (device removed) and subtracts the value it waits for. The proxy returns a
771 per-fence mirror. Completion events refresh it immediately. A 10 ms wait timeout also refreshes it if the
772 fence rewinds below the pending event's threshold. Slot 12 and the CPU `Signal` (10) refresh it synchronously.
773 The descriptor's second word is a code pointer, which is not called.
767- **The guard region.** Each table sits at the end of the first page of a 64 KiB reservation, and the rest 774- **The guard region.** Each table sits at the end of the first page of a 64 KiB reservation, and the rest
768 of that reservation is never committed. A slot past the table therefore faults on the vtable read itself, 775 of that reservation is never committed. A slot past the table therefore faults on the vtable read itself,
769 inside the reservation, and a vectored handler logs the slot before the fault goes on. A vtable read that 776 inside the reservation, and a vectored handler logs the slot before the fault goes on. A vtable read that
@@ -830,7 +837,7 @@ command object.
830| Item | Why it is blocked | 837| Item | Why it is blocked |
831|---|---| 838|---|---|
832| `PresentX` | No slot, signature, plane struct or swapchain/plane parameters. Prior art gives only names, the 2-plane/8-view limits and four flag names. | 839| `PresentX` | No slot, signature, plane struct or swapchain/plane parameters. Prior art gives only names, the 2-plane/8-view limits and four flag names. |
833| `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. | 840| `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. The retail title calls device slot 48 as (desc, riid, out) with a 32-byte desc (#6954), which differs from the (pDesc, pShaderQueueParams, riid, out) shape inferred above. |
834| `SuspendX` / `ResumeX` | No slot or signature. | 841| `SuspendX` / `ResumeX` | No slot or signature. |
835| 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. | 842| 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. |
836| 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`. | 843| 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`. |