Repository navigation
d3d12_xs: derive pipeline states for device slot 55 - #7759
LooperSalty wants to merge 8 commits into
Conversation
… proxy, not through slot 78 ItsNotRexed#6935 routes the Xbox device proxy's slot 78 to the title's SetFrameIntervalX, by design: the proxy is the title's device, answers ID3D12Device11 with itself, and shadows PC slots the way 62 and 76 already are. The test still called the PC ID3D12Device10::CreateReservedResource2 through the proxy, so the call reached SetFrameIntervalX and `tiles == 1` failed (@fever308's finding on ItsNotRexed#7049). The PC method is now checked on the Vulkan device behind the proxy, the same call and the same expectations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slot 55 is the console's CreateDerivedPipelineState(pBasePSO, n, pRecords, riid, ppv): n = 1..4 records of 0x14c bytes (a u32 tag, payload at +4) that patch the base PSO's state before a new PSO is created. - Slot 86 keeps a deep copy of the stream it creates on the returned PSO (ID3D12Object private data, released with the PSO): shader bytecode, stream-output and input-layout arrays and strings, cached blobs, and AddRef'd root signatures. - Slot 55 patches a copy of the base stream and creates the PSO through the slot 86 path, so a derived PSO can itself be a base. - Tags: 0 = DEPTH_STENCIL (or the DEPTH_STENCIL1 prefix), 1 = RASTERIZER, 2 = BLEND, 3 = sample mask (TomBox layout; the 1.0.2.1 title does not write it), 5 = StencilReadMask and StencilWriteMask bytes overlaid on the base's DEPTH_STENCIL, applied in record order. Other tags are refused. - A base not created through slots 86/55, a base without the matching subobject, malformed records, and n outside 1..4 are refused with E_FAIL or E_INVALIDARG and a null output, each logged once. - Slot 55 shadows PC CreateReservedResource1 (PC slot 55) on the proxy, as slot 78 shadows PC CreateReservedResource2 in ItsNotRexed#7125; the vulkan device test calls the PC method on the real device behind the proxy. Tests: pso_stream_test (synthetic streams: console subobject offsets, deep copy, patching, tag 5 overlay and record order, refusals) and device_proxy_test over WARP (refusals, graphics base via slot 86, n = 3 and n = 4 derivations, a derivation from a derived PSO). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwHrL5Lxc1rum25b6tnpo8
gut0to
left a comment
There was a problem hiding this comment.
Reviewed the new stream ownership and derivation path, slot dispatch, resource-description conversion, and added test coverage. The capture walker bounds each payload before copying, refuses unmodelled subobjects, retains root signatures, and copies pointer-backed stream data; derive applies only modeled tags and validates record count/state before creating the result. The slot 108 conversion zeroes the newer-only field and masks console-only layout/flag bits before forwarding. I found no actionable issue in the diff. I did not independently build this PR in this pass.
|
Tested What was run
Code & documentation findings
AI-assisted. |
|
tested: #7759 (d80c408, the slot-55 commit cherry-picked) on the retail 1.0.2.1 executable | os: Windows 11, MSVC 14.44 | gpu: RTX 4090, NVIDIA 617.42,
The conflicts against the stack were trivial: includes, the slot name table and AI-assisted (Claude Code). |
|
Measurement on the retail executable, as the author: the 1.0.2.1 title does not call slot 55 through the frame loop, so this PR is not exercised by the boot yet. Windows 11 26300, RTX 4070 SUPER (driver 610.88), So the call site at |
Claimed in: #7496 (comment) (status in #7694: #7694 (comment))
Depends on: #7201 (slot 86), #7125 (test policy for PC methods behind the proxy). Both are merged into this branch so it builds and tests on its own; the slot-55 change is the last commit.
What and why
Device slot 55 is the console's
CreateDerivedPipelineState(pBasePSO, n, pRecords, riid, ppv). The retail 1.0.2.1 title calls it (game+0x247a5c2, in0x2479f40) when a requested state differs from a PSO it already has.nis 1 to 4 records of 0x14c bytes, each a u32 tag and a payload at +4. Nothing served slot 55 before this PR.D3D12_DEPTH_STENCIL_DESC(0x34 bytes, or the prefix ofDEPTH_STENCIL1), 1 =D3D12_RASTERIZER_DESC(0x2c), 2 =D3D12_BLEND_DESC(0x148), 3 = sample mask (TomBox; the 1.0.2.1 title does not write it), 5 = theStencilReadMaskandStencilWriteMaskbytes, overlaid on the base's depth-stencil, applied in record order. Tags 0, 1, 2 and 5 were read from the title's record writes in the retail build (static disassembly). The title can send up to four records (rasterizer, depth-stencil, tag 5, blend on independent paths).noutside 1..4.CreateReservedResource1(PC slot 55) on the proxy, as slot 78 shadows PCCreateReservedResource2in d3d12_vulkan_device: check PC CreateReservedResource2 behind the Xbox proxy, not through slot 78 #7125. The vulkan device test calls the PC method on the real device behind the proxy.Tested
Windows 11 26300, RTX 4070 SUPER (driver 610.88), MSVC RelWithDebInfo.
pso_stream_test(new, no device): console subobject offsets, deep copy, patching of each tag, tag 5 overlay and record order, refusals. Written first; it failed on the stub, and it passes now.device_proxy_testover WARP: refusals (tag 6, missing subobject, base not kept, null records and riid,n= 0 andn= 5), a graphics base created through slot 86, derivations withn= 3 andn= 4, tag 2 alone, and a derivation from a derived PSO. All pass.d3d12_vulkan_device: passes.d3d12_indirect_dispatch_countandd3d12_indirect_rt, both already failing on main.Credit
The record size, payload offset and tag 3 layout come from TomBox's
create_derived_pso_x(omonkeyz/xbox-emulator, GPL-3.0, commitf89e4106fe,crates/compat/d3d12_xs/src/device_wrap.rs). The tag 0, 1, 2 and 5 layouts were checked against the title's writes. The code here is new.Limits
VIEW_INSTANCING) is not kept, so that PSO is refused as a base (logged once).RVAs and offsets only, no game data. AI-assisted (Claude Code).
cc @ItsNotRexed