runtime: add desktop d3d12_xs.dll shim for root-signature imports #346
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/351"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by alexander-src on 2026-11-21T23:05:31Z.
Change
Adds a desktop
d3d12_xs.dllshim (src/d3d12_xs_shim.cpp,src/d3d12_xs_shim.def) exporting the two root-signature functions that remained unresolved across the 16 pre-executable package DLLs aftersrc/xmem_shim.cppresolved the sixxmem.dlledges (docs/experiments.md, "Desktop xmem.dll" and "Six API call sites"):D3D12SerializeVersionedRootSignature: clears only the observed console flag pair (0x03000000) in a local stack copy forD3D_ROOT_SIGNATURE_VERSION_1_0andD3D_ROOT_SIGNATURE_VERSION_1_1descriptors before calling desktopd3d12.dll. Unobserved invalid flag bits and unknown versions stay untouched so desktopd3d12.dllstill rejects them withE_INVALIDARG.D3D12CreateRootSignatureDeserializer: forwards directly to desktopd3d12.dll, matching the embedded-container and raw-blob deserialization call shape recorded foramd_fidelityfx_upscaler_xbox.dll..defexport aliasing (PublicName=d3d12_xs_*) keeps internal symbols separate from desktopd3d12.libimports so there is no self-recursion or symbol clash.tests/d3d12_xs_shim_check.cpp(linkingd3d12_xs_shimdirectly via named PE imports, mirroringtests/xmem_shim_check.cpp), four CTest cases (d3d12_xs_shim_exports,d3d12_xs_shim_serialize,d3d12_xs_shim_deserialize,d3d12_xs_shim_warp_root), and documentation indocs/experiments.md.Verification
Commit
9094856(Linux host, no Windows SDK / MSVC / D3D12 runtime locally):python3 -B tests/docs_links_check.py->Checked 10 Markdown files and 69 links.python3 -B tests/bidi_controls_check.py->Checked 289 tracked source, script and build/CI files: no bidirectional controls.Windows build and the four CTest scenarios (
d3d12_xs_shim_exports,d3d12_xs_shim_serialize,d3d12_xs_shim_deserialize,d3d12_xs_shim_warp_root) could not be run locally on this Linux host and are exercised by thebuild-and-testWindows CI job.Evidence and follow-up
tests/compute.hlsl->pso_compute_embedded.h/pso_compute_stripped.h, MIT license) and synthetic C++D3D12_VERSIONED_ROOT_SIGNATURE_DESCdescriptors.d3d12.dllrejects0x01000000,0x02000000, and0x03000000withE_INVALIDARGwhiled3d12_xs.dllstrips only those bits, leaves the caller's struct untouched, preserves valid desktop flags, and matches desktop baseline bytes.d3d12_xs.dllstill rejects unobserved flag bits (0x04000000,0x07000000,0x80000000), a null descriptor, and an unknown root-signature version (99) withE_INVALIDARG.D3D12CreateRootSignatureDeserializerrejectspso_compute_stripped(noRTS0) and null/zero-length buffers withE_INVALIDARG.d3d12_xs_shim_warp_rootcreates a WARPID3D12RootSignaturefrom a0x03000000-tagged v1.1 descriptor serialized throughd3d12_xs.dlland builds a live compute PSO withpso_compute_stripped.d3d12_xs.dllimports. A localtools/pe_inventory.pyscan alongside bothxmem.dllandd3d12_xs.dllcan verify 0 unresolved edges across the 16 package DLLs; any furtherd3d12_xs.dllexports needed by a main executable stay separate work.Checklist
AI-assisted: yes.
Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-21T23:22:14Z.
Independent Windows run of #351 at the current head, after the two test follow-ups.
Environment: Windows 11 build 26200, desktop
d3d12.dll/D3D12Core.dll10.0.26100.9818, MSVC 19.44.35230 (VS Build Tools 2022), Windows SDK 10.0.26100.0, NVIDIA GeForce RTX 3070 (driver 32.0.16.2101), Python 3.12. D3D12 debug layer not installed on this PC.Tested head:
e30921a2a13c41f8b1b839cdd4aef3277f9def5d.Result: 150/150, with the usual 3 capability skips on this PC (
bvh_wave64_hardware,bvh_wave64_warp,wave_shuffle_warp). The four shim tests pass:For the record, this matches what I saw at
9094856on the same machine:d3d12_xs_shim_serializefailed there because desktopD3D12SerializeVersionedRootSignature10.0.26100.9818 accepts0x80000000on its own (returnsS_OKand a blob), so the shim, which passes it through unchanged, succeeded too. A standalone probe of everyserialize_checks()step showed no other difference from the test's expectations. With0x08000000in its place, desktop and shim both returnE_INVALIDARGhere, and the new failure messages would have made the old cause visible in the CI log.AI-assisted: run and prepared with the support of Roan System.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T03:45:04Z.
The shim and its Windows checks passed review at
e30921a. GitHub refused the merge after main moved. A fresh trial againstc1ca45bshows a single conflict indocs/experiments.md; the code and test registration merge cleanly. Please retain the root-signature shim results alongside current main’s experiment notes. I’ll recheck the resolved head.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T04:00:20Z.
I resolved the documentation conflict on the PR branch, keeping both experiment sections. All four d3d12_xs_shim_* tests passed locally, including the WARP root-signature test. Windows CI passed and GitHub confirms the merge.