feat(d3d12_x): add root signature and pipeline state objects #64

Manually merged
github merged 1 commit from gh-pr/64/head into gh-pr/64/base 2026-11-26 19:17:03 +00:00
Owner

@⁠Dark3581 on GitHub · 2026-11-23 01:14 UTC · original
Dark3581:feat/pipeline-objects → main · +584 −35 · 13 files · 1 commits · merged 2026-11-23 01:17 UTC

What

ID3D12RootSignature and ID3D12PipelineState as objects, plus binding them and their root arguments on command lists:

  • objects/RootSignature.cpp: holds the layout the host's d3d12.dll deserializes from the title's blob (#56). A missing or junk blob is refused.
  • objects/PipelineObject.cpp (PipelineStateObject):
    • compute and graphics descriptions resolve through the store (#43, #47) and get their pipeline from the library, cache first;
    • holds a reference to its root signature;
    • a description without a root signature is refused, because reading one embedded in the shader is not implemented;
    • library refusals and failures return an error naming the cause;
    • GetCachedBlob returns E_NOTIMPL, because a title's blobs hold console GPU code.
  • objects/CommandList.cpp:
    • SetPipelineState, an initial pipeline state in Create and Reset, and ClearState with or without one.
    • Set{Compute,Graphics}RootSignature: a different signature clears that bind point's arguments; setting the same one keeps them.
    • All twelve root argument setters fill a per-bind-point root-word image at the layout's offsets:
      • constants at their word offset;
      • root CBV/SRV/UAV addresses as two words, checked against the buffer window;
      • descriptor tables as one word, which must lie in the bound heap of their type and below 4 GB.
    • Draws, dispatches and ExecuteIndirect still stop the title, now with the real reason: how root arguments, descriptor heaps and the heap base reach the translated shader's user data is unknown until a title's calls show it.
  • The README, ARCHITECTURE and debt docs are updated. The still-unfolded command list entry from #62 is corrected, since pipeline state and root arguments no longer stop the title.

Tested

Windows 10, RTX 3070 Ti (driver 621.14), Khronos validation layer.

  • New pso_probe pso-objects <store> compute|graphics ..., run by the pipeline_state test against its compute store and its graphics store (real SPIR-V modules):

    • root signatures from host-serialized blobs, with their layout (9 root words, offsets 6 and 7), and a junk blob refused;
    • pipeline states refused without a root signature, and with a pixel shader in the vertex slot;
    • created pipeline states with their pipeline, bind point and signature; GetCachedBlob;
    • a list created with an initial pipeline state, SetDescriptorHeaps, all four parameter kinds checked word by word, same and different root signatures, and ClearState both ways;
    • execution through the queue.

    Compute: 17 checks; graphics: 18 checks; 0 validation errors.

  • MinGW ctest: 72 of 72. With MSVC 2022, both pso-objects runs, descriptors-gpu and commandlist-gpu pass, and every target builds except ab_gameinput, which needs gameinput.lib, which this machine doesn't have. The MSVC build caught a test variable named small, a windows.h macro; it is renamed. python tools/check_conventions.py and debt_fold.py --check: ok.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • python tools/check_conventions.py passes (no comments in code, one declaration per export, Conventional Commit subjects)
  • Unimplemented paths stop (AbxNotImplemented / AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragment
  • Known gaps added, changed or removed through docs/dev/debt/changes/<branch>.md
  • Generic behaviour, not specific to one title
  • No game files, keys, notes or logs added to the repository
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • Source of behaviour: public D3D12 headers and documentation (root signature cost: 1 word per constant, 2 per root descriptor, 1 per table)
  • AI-assisted: yes
**@⁠Dark3581** on GitHub · 2026-11-23 01:14 UTC · [original](https://github.com/Dark3581/AnyBox/pull/64) `Dark3581:feat/pipeline-objects` → `main` · +584 −35 · 13 files · 1 commits · merged 2026-11-23 01:17 UTC ### What `ID3D12RootSignature` and `ID3D12PipelineState` as objects, plus binding them and their root arguments on command lists: - **`objects/RootSignature.cpp`**: holds the layout the host's `d3d12.dll` deserializes from the title's blob (#56). A missing or junk blob is refused. - **`objects/PipelineObject.cpp`** (`PipelineStateObject`): - compute and graphics descriptions resolve through the store (#43, #47) and get their pipeline from the library, cache first; - holds a reference to its root signature; - a description without a root signature is refused, because reading one embedded in the shader is not implemented; - library refusals and failures return an error naming the cause; - `GetCachedBlob` returns `E_NOTIMPL`, because a title's blobs hold console GPU code. - **`objects/CommandList.cpp`**: - `SetPipelineState`, an initial pipeline state in `Create` and `Reset`, and `ClearState` with or without one. - `Set{Compute,Graphics}RootSignature`: a different signature clears that bind point's arguments; setting the same one keeps them. - All twelve root argument setters fill a per-bind-point root-word image at the layout's offsets: - constants at their word offset; - root CBV/SRV/UAV addresses as two words, checked against the buffer window; - descriptor tables as one word, which must lie in the bound heap of their type and below 4 GB. - Draws, dispatches and `ExecuteIndirect` still stop the title, now with the real reason: how root arguments, descriptor heaps and the heap base reach the translated shader's user data is unknown until a title's calls show it. - The README, ARCHITECTURE and debt docs are updated. The still-unfolded command list entry from #62 is corrected, since pipeline state and root arguments no longer stop the title. ### Tested Windows 10, RTX 3070 Ti (driver 621.14), Khronos validation layer. - New `pso_probe pso-objects <store> compute|graphics ...`, run by the `pipeline_state` test against its compute store and its graphics store (real SPIR-V modules): - root signatures from host-serialized blobs, with their layout (9 root words, offsets 6 and 7), and a junk blob refused; - pipeline states refused without a root signature, and with a pixel shader in the vertex slot; - created pipeline states with their pipeline, bind point and signature; `GetCachedBlob`; - a list created with an initial pipeline state, `SetDescriptorHeaps`, all four parameter kinds checked word by word, same and different root signatures, and `ClearState` both ways; - execution through the queue. Compute: 17 checks; graphics: 18 checks; 0 validation errors. - MinGW `ctest`: 72 of 72. With MSVC 2022, both `pso-objects` runs, `descriptors-gpu` and `commandlist-gpu` pass, and every target builds except `ab_gameinput`, which needs `gameinput.lib`, which this machine doesn't have. The MSVC build caught a test variable named `small`, a `windows.h` macro; it is renamed. `python tools/check_conventions.py` and `debt_fold.py --check`: ok. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] `python tools/check_conventions.py` passes (no comments in code, one declaration per export, Conventional Commit subjects) - [x] Unimplemented paths stop (`AbxNotImplemented` / `AbxUnsupported`); silent stubs are listed under Silent stubs through a debt fragment - [x] Known gaps added, changed or removed through `docs/dev/debt/changes/<branch>.md` - [x] Generic behaviour, not specific to one title - [x] No game files, keys, notes or logs added to the repository - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] Source of behaviour: public D3D12 headers and documentation (root signature cost: 1 word per constant, 2 per root descriptor, 1 per table) - [x] AI-assisted: yes
ID3D12RootSignature holds the host-deserialized layout and ID3D12PipelineState a pipeline from the library. Command lists bind pipeline states (initial ones included) and keep root arguments as a root-word image per bind point; draws and dispatches stop until the mapping to the translated shaders' push constants is known.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:16:59 +00:00
github manually merged commit 53982bfa3e into gh-pr/64/base 2026-11-26 19:17:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.