[PR #2292] d3d12: the deferred path reads console streams with the console's numbering (CONSOLE-STREAM-ON-DEMAND-REREAD) #2296

Open
opened 2026-11-26 21:20:43 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2292
Author: @star41905453-coder
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: console-stream-on-demand


📝 Commits (1)

  • 74cad38 d3d12: the deferred path reads console streams with the console's numbering (CONSOLE-STREAM-ON-DEMAND-REREAD)

📊 Changes

2 files changed (+49 additions, -23 deletions)

View changed files

📝 runtime/CMakeLists.txt (+5 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+44 -23)

📄 Description

With LEONIDA_PIPELINE_COMPILE=on-demand every PSO from a console-numbered stream is refused, and this is the switch a title with console PSOs needs.

prepare_console_stream — the deferred entry point Xbox CreatePipelineState uses when a device prepares PSOs on bind — parsed the stream with PC numbering and returned before the console re-read that the eager path does, so a console type 24 arrived as an AS and answered E_NOTIMPL. The record capture right after had the same fault one level down: it walked the stream as a PC one, found no console subobject and gave E_INVALIDARG — the case the rasterizer subobject in d3d12_mesh_test hits.

What changes:

  • one helper, parse_console_or_pc_stream, used by both entry points. The deferred one is handed console streams, so it reads console-first and falls back to the PC reading; the eager one keeps its existing PC-first rule, so a stream the PC reading accepts is never read differently.
  • the record is captured with the numbering actually taken, instead of always as a PC stream. Slot 55 (derive) needs that record.

Out of scope but worth knowing: on-demand also exercises the depth-bounds extras path, so this and #2234 meet.

Test — the existing console-stream step of d3d12_mesh_test now also runs under the switch, as d3d12_mesh_on_demand (new ctest). On main it stops at SUCCEEDED(console_hr) with the refusal; with this it passes, both console streams created, and the derived PSO through slot 55 still works.

Run: d3d12_mesh and d3d12_mesh_on_demand both pass here; the wider group (write_back, title_va, geometry_views, compute) passes.

Item: CONSOLE-STREAM-ON-DEMAND-REREAD, claimed in #1608.


🔄 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/2292 **Author:** [@star41905453-coder](https://github.com/star41905453-coder) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `console-stream-on-demand` --- ### 📝 Commits (1) - [`74cad38`](https://github.com/ubiquitarianism/leonida/commit/74cad383203fd8a1c76a6463e8f7a11df689fda3) d3d12: the deferred path reads console streams with the console's numbering (CONSOLE-STREAM-ON-DEMAND-REREAD) ### 📊 Changes **2 files changed** (+49 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+5 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+44 -23) </details> ### 📄 Description With `LEONIDA_PIPELINE_COMPILE=on-demand` every PSO from a console-numbered stream is refused, and this is the switch a title with console PSOs needs. `prepare_console_stream` — the deferred entry point Xbox `CreatePipelineState` uses when a device prepares PSOs on bind — parsed the stream with PC numbering and returned before the console re-read that the eager path does, so a console type 24 arrived as an AS and answered `E_NOTIMPL`. The record capture right after had the same fault one level down: it walked the stream as a PC one, found no console subobject and gave `E_INVALIDARG` — the case the rasterizer subobject in `d3d12_mesh_test` hits. What changes: - one helper, `parse_console_or_pc_stream`, used by both entry points. The deferred one is handed console streams, so it reads **console-first** and falls back to the PC reading; the eager one keeps its existing PC-first rule, so a stream the PC reading accepts is never read differently. - the record is captured with the numbering actually taken, instead of always as a PC stream. Slot 55 (derive) needs that record. Out of scope but worth knowing: `on-demand` also exercises the depth-bounds extras path, so this and #2234 meet. **Test** — the existing console-stream step of `d3d12_mesh_test` now also runs under the switch, as `d3d12_mesh_on_demand` (new ctest). On `main` it stops at `SUCCEEDED(console_hr)` with the refusal; with this it passes, both console streams created, and the derived PSO through slot 55 still works. **Run**: `d3d12_mesh` and `d3d12_mesh_on_demand` both pass here; the wider group (`write_back`, `title_va`, `geometry_views`, `compute`) passes. Item: CONSOLE-STREAM-ON-DEMAND-REREAD, claimed in #1608. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#2296
No description provided.