Run the GPU tests on any adapter: XCL_ADAPTER, mesh-shader check, the test title's device from d3d12_xs #40
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/41"
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 ivall/xcl. Originally posted by grahamster2 on 2026-11-22T19:48:46Z.
Summary
Running the test suite on each GPU of a two-GPU machine (NVIDIA RTX 3080 + the AMD Radeon iGPU of a Ryzen 5 7600X) turned up three things, one commit each:
XCL_ADAPTER: pick the D3D12 adapter. The title's device took the first hardware adapter in high-performance order and the GPU test bench always took adapter 0, so the second GPU could not be tested.d3d12_adapterinxcl.tomlnow also takes a number (that hardware adapter in high-performance order) or a part of the adapter's name (radeon,rtx 3080).XCL_ADAPTERoverrides it, the same wayXCL_RAYTRACINGoverridesraytracing. The newgpu::adaptermodule holds the choice, andhle::d3d12x::realandgpu::recomp::runnerboth use it. If the name matches no adapter, the title logs the adapters it found and falls back to auto. The test bench gives the same message as its skip reason.auto/warpbehave as before.Mesh draws are skipped on adapters without mesh shaders.
gpu_mesh_mode_two_passesandgpu_geometry_mode_es_gs_stripfailed withE_INVALIDARGat mesh PSO creation on the RDNA2 iGPU. That adapter has wave 32–64 but reportsMeshShaderTierNOT_SUPPORTED. The runner now readsD3D12_OPTIONS7, and the two tests skip with a note, as the wave64 tests do.The test title takes its device from
d3d12_xs.dll. The title declaresD3D12CreateDevice/D3D12SerializeRootSignatureas raw-dylib imports fromd3d12_xs. Thewindowscrate imports the same two symbols fromd3d12.dll, and the linker keeps that one:xcl inspecton the built title showsd3d12.dll: 2 Windowsand nod3d12_xsimport. So the title called the system'sD3D12CreateDevice(NULL). D3D12 hands out one device per adapter, so the title still got XCL's device as long as XCL's adapter was the default adapter, and the e2e checks passed. On another adapter the title got a device XCL had never adopted. 5 D3D12.X checks then failed (no fallback PSO, noIDXGIDevice1,CreatePlacedResourceXE_INVALIDARG) and the run ended in an access violation inD3D12Core.dll. This also hits any machine where the high-performance GPU is not the display adapter, e.g. a laptop. The title now looks both functions up ind3d12_xs.dllwithLoadLibraryW/GetProcAddress, which XCL serves from its HLE module.gpu_pso_e2e: the same mesh-shader check for the retail-pack tests. Console GS and NGG programs are drawn through a mesh pass. On the iGPU, fourXCL_SAMPLE_RPFtests failed withE_INVALIDARGat mesh pipeline creation:retail_es_gs_voxelize_geometry_mode,retail_gs_pipeline_through_the_hook,retail_mesh_pipelines_through_the_hook, and the mesh half ofretail_pipelines_built_in_the_background_behind_a_stand_in. They now checkD3D12_OPTIONS7on the backend's device and skip that part with a note. The VS / PS parts still run.Plus one line in the README's Tests section.
Verification
Windows 11 Pro 26200, Rust stable MSVC, DXC 1.8.2502 from SDK 10.0.26100.
cargo test --workspace --release --no-fail-fast -- --test-threads=4, once per adapter, noXCL_SAMPLE_*set:XCL_ADAPTERnvidiaradeonBefore this branch, the default (RTX 3080) run passed too (352 passed, 2 fewer because the new unit tests were not there yet). Forcing the iGPU, which needs commit 1, gave 2 failed recompiler tests (commit 2) and a failed e2e test title with 5 D3D12.X checks failing (commit 3). New unit tests:
gpu::adapter::tests::selector_parsing,selector_matching.With
XCL_SAMPLE_RPFset to a retailshaders.rpf(26 503 records),gpu_pso_e2egives 6 / 6 on the iGPU. On the RTX 3080 it gives 4 / 6. The 2 failures there areretail_mesh_pipelines_through_the_hook(7 / 7 mesh pipelines fail) and the mesh half of the background-build test. That is the wave64-MS-on-wave32 limit discussed in #39, and this branch does not change it.Not covered: a few probes and tests still create their own device with
D3D12CreateDevice(None, …)(the default adapter):heap_probe.rs, two ignored experiments inrecomp/tests.rs,texture.rs,list_x.rs,mfplat.rs. I left them alone.The full per-adapter results are in #42.
Imported from ivall/xcl. Originally posted by ivall on 2026-11-22T21:38:06Z.
Thanks, merged! I tested it on top of current
main, after #39 / #44 / #45 and the test title's new checks:gpu_pso_e2e6 / 6 with a retailshaders.rpf.d3d12*.dllimport at all. Its D3D12.X checks really run on XCL's device, including the three added today (descriptor heaps after a large graphics reservation, committed textures past the coherent room, the hidden title window). I had run into the same linker binding withCreateWindowExWthere.auto, a game still picks the same adapter ("AMD Radeon RX 9070 (16191 MiB VRAM)") and runs as before.