[PR #1058] [CLOSED] d3d12_xs: derive pipeline states for device slot 55 (RT-PSO-STREAM-SLOT55) #1096

Closed
opened 2026-11-26 20:20:04 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1058
Author: @Taffyyy-ops
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: feat/xs-pso-stream-slot55


📝 Commits (1)

  • f513564 d3d12_xs: derive pipeline states for device slot 55 (RT-PSO-STREAM-SLOT55)

📊 Changes

10 files changed (+1085 additions, -36 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+9 -0)
📝 runtime/CMakeLists.txt (+41 -20)
📝 runtime/shims/d3d12_xs_device.cpp (+66 -1)
📝 runtime/shims/d3d12_xs_device.h (+1 -1)
➕ runtime/shims/d3d12_xs_pso_stream.cpp (+331 -0)
➕ runtime/shims/d3d12_xs_pso_stream.h (+74 -0)
📝 runtime/test/d3d12_vulkan_device_test.cpp (+3 -2)
📝 runtime/test/device_proxy_test.cpp (+231 -11)
➕ runtime/test/pso_stream_test.cpp (+309 -0)
📝 runtime/test/xs_proxy_mock_test.cpp (+20 -1)

📄 Description

Claimed in the coordination issue as: RT-PSO-STREAM-SLOT55 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7139045785)

Depends on: #727

What and why

Restores and adapts Xbox device slot 55 (CreateDerivedPipelineState) and runtime/shims/d3d12_xs_pso_stream.{h,cpp} + runtime/test/pso_stream_test.cpp from ancestor commit 6946344eb0 (originally authored by tf, dropped by merge 6dece9231):

  • Pipeline state stream deep copy and derivation (runtime/shims/d3d12_xs_pso_stream.{h,cpp}): captures and deep-copies supported D3D12_PIPELINE_STATE_SUBOBJECT_DESC subobjects onto ID3D12Object private data (released automatically with the PSO), applies 1..4 0x14c-byte records in order (tag 0 DEPTH_STENCIL/DEPTH_STENCIL1, tag 1 RASTERIZER, tag 2 BLEND, tag 3 SAMPLE_MASK, tag 5 stencil read/write mask overlay), and refuses unmodelled subobjects (such as VIEW_INSTANCING) or invalid counts/tags. Hardened with deep-copy of STREAM_OUTPUT SemanticName strings via shared copy_semantic_entries, a 4096-entry bound on subobject descriptor arrays, and cleanup of kRecordOwnerGuid if SetPrivateData fails in attach_pso_record.
  • Xbox device proxy (runtime/shims/d3d12_xs_device.{h,cpp}): wires slot 55 (CreateDerivedPipelineState -> proxy_create_derived_pso -> create_pso_from_stream via PC slot 47) and marks slot 55 in device_slot_overridden(55). Shares create_pso_from_stream / keep_pso_stream so #727's slot 86 routes cleanly onto it once merged, while staying completely standalone-buildable and testable on current main.
  • Build and tests (runtime/CMakeLists.txt, pso_stream_test.cpp, device_proxy_test.cpp, xs_proxy_mock_test.cpp, d3d12_vulkan_device_test.cpp): adds pso_stream_test under the Windows D3D12 guard (so Linux and macOS CI remain unaffected), links shims/d3d12_xs_pso_stream.cpp into all targets compiling shims/d3d12_xs_device.cpp, updates d3d12_vulkan_device_test to query ID3D12Device4 on inner for PC CreateReservedResource1 (since proxy slot 55 is Xbox CreateDerivedPipelineState), adds WARP graphics/compute derivation & chained-derivation coverage in device_proxy_test, and adds mock slot 55 refusal checks in xs_proxy_mock_test.
  • Documentation (docs/d3d12_vulkan.md): documents device slot 55, tags 0/1/2/3/5, refusal rules, and #727 slot 86 relationship.

Tested

  • MSVC 19.44 (vcvars64.bat && cmake --build runtime/build, [154/154] + final [2/2]): 0 errors, 0 new /W4 warnings.
  • Targeted CTest suite (LEONIDA_VK_DEVICE=NVIDIA): 11/11 passed:
    • device_proxy, device_proxy_trace
    • xs_proxy_mock, xs_proxy_mock_no_reserve, xs_proxy_mock_no_protect, xs_proxy_mock_no_handler, xs_proxy_mock_env_slots, xs_proxy_mock_env_slots_invalid
    • pso_stream, root_sig, d3d12_vulkan_device
  • Python & hygiene checks: tests/test_ctest_registration.py (4/4 OK), tests/test_docs_links.py (16/16 OK), tests/test_docs_repo_paths.py (3/3 OK), tests/test_docs_encoding.py (1/1 OK), tests/test_docs_repeated_lines.py (2/2 OK), tests/test_docs_cli_flags.py (4/4 OK), tests/test_docs_list_items.py (3/3 OK), scripts/check_no_game_data.py (pass), git diff --check main..HEAD (clean).

GPUs tested: NVIDIA GeForce RTX 5060 Laptop GPU (driver 621.24, Vulkan 1.4.357, Windows 11) + WARP

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1058 **Author:** [@Taffyyy-ops](https://github.com/Taffyyy-ops) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/xs-pso-stream-slot55` --- ### 📝 Commits (1) - [`f513564`](https://github.com/ubiquitarianism/leonida/commit/f51356450ec3aad69142a60c3a3529b022f9ae49) d3d12_xs: derive pipeline states for device slot 55 (RT-PSO-STREAM-SLOT55) ### 📊 Changes **10 files changed** (+1085 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+9 -0) 📝 `runtime/CMakeLists.txt` (+41 -20) 📝 `runtime/shims/d3d12_xs_device.cpp` (+66 -1) 📝 `runtime/shims/d3d12_xs_device.h` (+1 -1) ➕ `runtime/shims/d3d12_xs_pso_stream.cpp` (+331 -0) ➕ `runtime/shims/d3d12_xs_pso_stream.h` (+74 -0) 📝 `runtime/test/d3d12_vulkan_device_test.cpp` (+3 -2) 📝 `runtime/test/device_proxy_test.cpp` (+231 -11) ➕ `runtime/test/pso_stream_test.cpp` (+309 -0) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+20 -1) </details> ### 📄 Description Claimed in the coordination issue as: RT-PSO-STREAM-SLOT55 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7139045785) Depends on: #727 ### What and why Restores and adapts Xbox device slot 55 (`CreateDerivedPipelineState`) and `runtime/shims/d3d12_xs_pso_stream.{h,cpp}` + `runtime/test/pso_stream_test.cpp` from ancestor commit `6946344eb0` (originally authored by `tf`, dropped by merge `6dece9231`): - **Pipeline state stream deep copy and derivation (`runtime/shims/d3d12_xs_pso_stream.{h,cpp}`):** captures and deep-copies supported `D3D12_PIPELINE_STATE_SUBOBJECT_DESC` subobjects onto `ID3D12Object` private data (released automatically with the PSO), applies `1..4` `0x14c`-byte records in order (tag `0` `DEPTH_STENCIL`/`DEPTH_STENCIL1`, tag `1` `RASTERIZER`, tag `2` `BLEND`, tag `3` `SAMPLE_MASK`, tag `5` stencil read/write mask overlay), and refuses unmodelled subobjects (such as `VIEW_INSTANCING`) or invalid counts/tags. Hardened with deep-copy of `STREAM_OUTPUT` `SemanticName` strings via shared `copy_semantic_entries`, a 4096-entry bound on subobject descriptor arrays, and cleanup of `kRecordOwnerGuid` if `SetPrivateData` fails in `attach_pso_record`. - **Xbox device proxy (`runtime/shims/d3d12_xs_device.{h,cpp}`):** wires slot 55 (`CreateDerivedPipelineState` -> `proxy_create_derived_pso` -> `create_pso_from_stream` via PC slot 47) and marks slot 55 in `device_slot_overridden(55)`. Shares `create_pso_from_stream` / `keep_pso_stream` so `#727`'s slot 86 routes cleanly onto it once merged, while staying completely standalone-buildable and testable on current `main`. - **Build and tests (`runtime/CMakeLists.txt`, `pso_stream_test.cpp`, `device_proxy_test.cpp`, `xs_proxy_mock_test.cpp`, `d3d12_vulkan_device_test.cpp`):** adds `pso_stream_test` under the Windows D3D12 guard (so Linux and macOS CI remain unaffected), links `shims/d3d12_xs_pso_stream.cpp` into all targets compiling `shims/d3d12_xs_device.cpp`, updates `d3d12_vulkan_device_test` to query `ID3D12Device4` on `inner` for PC `CreateReservedResource1` (since proxy slot 55 is Xbox `CreateDerivedPipelineState`), adds WARP graphics/compute derivation & chained-derivation coverage in `device_proxy_test`, and adds mock slot 55 refusal checks in `xs_proxy_mock_test`. - **Documentation (`docs/d3d12_vulkan.md`):** documents device slot 55, tags `0`/`1`/`2`/`3`/`5`, refusal rules, and `#727` slot 86 relationship. ### Tested - MSVC 19.44 (`vcvars64.bat && cmake --build runtime/build`, `[154/154]` + final `[2/2]`): **0 errors**, **0 new `/W4` warnings**. - Targeted CTest suite (`LEONIDA_VK_DEVICE=NVIDIA`): **11/11 passed**: - `device_proxy`, `device_proxy_trace` - `xs_proxy_mock`, `xs_proxy_mock_no_reserve`, `xs_proxy_mock_no_protect`, `xs_proxy_mock_no_handler`, `xs_proxy_mock_env_slots`, `xs_proxy_mock_env_slots_invalid` - `pso_stream`, `root_sig`, `d3d12_vulkan_device` - Python & hygiene checks: `tests/test_ctest_registration.py` (4/4 OK), `tests/test_docs_links.py` (16/16 OK), `tests/test_docs_repo_paths.py` (3/3 OK), `tests/test_docs_encoding.py` (1/1 OK), `tests/test_docs_repeated_lines.py` (2/2 OK), `tests/test_docs_cli_flags.py` (4/4 OK), `tests/test_docs_list_items.py` (3/3 OK), `scripts/check_no_game_data.py` (pass), `git diff --check main..HEAD` (clean). GPUs tested: NVIDIA GeForce RTX 5060 Laptop GPU (driver 621.24, Vulkan 1.4.357, Windows 11) + WARP AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:04 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1096
No description provided.