mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #1779] [CLOSED] d3d12: support console-numbered PSO streams under LEONIDA_PIPELINE_COMPILE=on-demand (RT-ONDEMAND-CONSOLE-STREAM-ENUM) #1792
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1792
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1779
Author: @IlyassRS3
Created: 11/25/2026
Status: ❌ Closed
Base:
main← Head:fix/rt-ondemand-console-stream-enum📝 Commits (1)
4045610d3d12: handle console stream numbering under on-demand pipeline compile📊 Changes
5 files changed (+172 additions, -55 deletions)
View changed files
📝
runtime/CMakeLists.txt(+3 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+85 -49)📝
runtime/shims/d3d12_xs_device.cpp(+9 -5)📝
runtime/test/d3d12_mesh_test.cpp(+27 -1)📝
runtime/test/pso_stream_test.cpp(+48 -0)📄 Description
Summary
Fixes console-numbered pipeline state streams from Xbox device slot 86 under
LEONIDA_PIPELINE_COMPILE=on-demand(--first-run-ui), following up @thiefyzheng's finding in #1608 (#1608#issuecomment-7161103050).RT-ONDEMAND-CONSOLE-STREAM-ENUMPipelineState::resolve_typeis intentionally untouched so this stays conflict-free with #1695.Root cause
When
LEONIDA_PIPELINE_COMPILE=on-demandis active (--first-run-ui),set_device_outerregistersDevice::prepare_console_streamasproxy->prepare_stream, so Xbox device slot 86 (create_pso_from_stream) bypassesDevice::CreatePipelineState:prepare_console_streamcalledparse_pipeline_stream(source, stream)with PC numbering only, omitting the console subobject numbering retry (type 24=MS,type 26=RASTERIZER1). A console mesh stream with raw tag24alone parsed as PCASand returnedE_NOTIMPL; with raw tag26(RASTERIZER1read as larger PCDEPTH_STENCIL2) it returnedE_INVALIDARG.prepare_console_streamcalledPsoStreamRecord::capture(source)without passingused_console, so raw console tag26failedwalk()(E_INVALIDARG) and raw console tag24was never rewritten to canonical PC numbering (25=MS) for slot-55 derivation (derive_stream) or bind-time realization (PipelineState::resolve_type).prepare_console_streamdid not mirror eagercreate_graphics's up-front refusals for missingVK_EXT_mesh_shader,StreamOutput,MS+GS, or a mesh shader missingroot_window, andcreate_pso_from_streamskippedLEONIDA_PSO_STREAM_AUDITon theprepare_streampath.Changes
runtime/shims/d3d12_vulkan_device.cpp:parse_pipeline_stream_any()soDevice::CreatePipelineStateandDevice::prepare_console_streamshare the exact same PC-first / console-fallback parser andused_console_streamtracking.used_consoletoPsoStreamRecord::capture(source, used_console)inprepare_console_stream, mirror eager refusals (AS,HS/DS/StreamOutput, missingVK_EXT_mesh_shader,MS+GS, meshgraphics_root_window), and recordPipelineStream::Refused/PipelineStream::Mesh.runtime/shims/d3d12_xs_device.cpp:LEONIDA_PSO_STREAM_AUDITonprepare_streamrefusals too and avoid duplicatekeep_pso_streamwhenprepare_streamalready captured the record.runtime/test/d3d12_mesh_test.cpp&runtime/CMakeLists.txt:d3d12_mesh_test's temporary shader library directory per-process (GetCurrentProcessId()) sod3d12_meshandd3d12_mesh_on_demandcan run concurrently underctest -j.VK_EXT_mesh_shader(E_NOTIMPL),ms_oldwithoutroot_window(E_INVALIDARG), and non-mesh DXIL kind 14 in tag 24.d3d12_mesh_on_demandwithLEONIDA_PIPELINE_COMPILE=on-demand(exercises slot-86 console streams with/without raw tag26, slot-55 derivation, bind-timeresolve_type, and fullDispatchMeshpixel readback).runtime/test/pso_stream_test.cpp:test_console_stream_normalizationcovering raw console tags24(MS) and26(RASTERIZER1) rejection underconsole=false, tag normalization (24 -> 25,26 -> 27) and deep copy underconsole=true, and subsequent slot-55derive_stream.Verification
d3d12_vulkan_device.cpp,d3d12_xs_device.cpp,d3d12_mesh_test.cpp, andpso_stream_test.cppare Windows-only and could not be compiled or run locally — relies on Windows CI / Windows GPU verification ofpso_stream,d3d12_mesh, andd3d12_mesh_on_demand).python3 -I scripts/check_no_game_data.py runtime/shims/d3d12_vulkan_device.cpp runtime/shims/d3d12_xs_device.cpp runtime/test/d3d12_mesh_test.cpp runtime/test/pso_stream_test.cpp runtime/CMakeLists.txt— passpython3 -I tests/test_text_write_line_endings.py— 3/3 pass🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.