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

Open
github-bot wants to merge 1 commit from github-bot/gh-2292 into main AGit
Owner

@⁠star41905453-coder on GitHub · 2026-11-26 12:52 UTC · original
star41905453-coder:console-stream-on-demand → main · +49 −23 · 2 files · 1 commits · open

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.

**@⁠star41905453-coder** on GitHub · 2026-11-26 12:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2292) `star41905453-coder:console-stream-on-demand` → `main` · +49 −23 · 2 files · 1 commits · open 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.
With LEONIDA_PIPELINE_COMPILE=on-demand every PSO from a console-numbered
stream was refused with E_NOTIMPL: prepare_console_stream parsed the stream with
PC numbering and returned before the console re-read CreatePipelineState does,
so a console type 24 arrived as an AS. The record capture that follows had the
same fault - it walked the stream as a PC one, found no console subobject and
gave E_INVALIDARG, which is what the rasterizer subobject case hit.

Both parsers now share one helper. It reads console-first where the stream is
known to be the console's (the deferred entry point, which is handed console
streams by Xbox CreatePipelineState) and keeps the PC-first rule elsewhere, so a
PC stream is never read differently. The record is captured with the numbering
that was actually taken, which is what slot 55 needs to derive from these PSOs.

Test: the console-stream step of d3d12_mesh_test now runs under
LEONIDA_PIPELINE_COMPILE=on-demand as its own ctest (d3d12_mesh_on_demand); on
main it stops there with the refusal above.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:58:37 +00:00
github-bot force-pushed github-bot/gh-2292 from 74cad38320 to 7d23021d69 2026-11-27 03:25:33 +00:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2292/head:github-bot/gh-2292'
git switch 'github-bot/gh-2292'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2292'
git switch 'github-bot/gh-2292'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2292'
git switch 'github-bot/gh-2292'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2292'
git switch 'main'
git merge --squash 'github-bot/gh-2292'
git switch 'main'
git merge --ff-only 'github-bot/gh-2292'
git switch 'main'
git merge 'github-bot/gh-2292'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.