Repository navigation
Run the GPU tests on any adapter: XCL_ADAPTER, mesh-shader check, the test title's device from d3d12_xs - #41
Merged
Conversation
The title's device took the first hardware adapter in high-performance
order and the GPU test bench always took adapter 0, so on a machine with
two GPUs only one of them could be tested.
`d3d12_adapter` in xcl.toml now also takes a number (that hardware
adapter in high-performance order) or a part of the adapter's name
("radeon", "rtx 3080"), and XCL_ADAPTER overrides it, as XCL_RAYTRACING
does for `raytracing`. gpu::adapter holds the choice; hle::d3d12x::real
and gpu::recomp::runner both use it. A name that matches no adapter is
logged with the adapters there are and the title falls back to auto;
the test bench reports it as the reason its GPU tests are skipped.
gpu_mesh_mode_two_passes and gpu_geometry_mode_es_gs_strip draw through runner::mesh_draw and failed with E_INVALIDARG at mesh pipeline creation on an AMD Radeon iGPU (RDNA2, Ryzen 7600X), which has wave64 but reports mesh shader tier NOT_SUPPORTED. The runner now reads the tier (D3D12_OPTIONS7) and the two tests skip with a note when it is missing, like the wave64 tests do.
….dll The title declared D3D12CreateDevice and D3D12SerializeRootSignature as raw-dylib imports from d3d12_xs, but the windows crate imports the same two functions from d3d12.dll and the linker kept that one: `xcl inspect` on the built title shows `d3d12.dll: 2 Windows` and no d3d12_xs import. So the title called the system's D3D12CreateDevice for the default adapter. D3D12 returns one device per adapter, so this was XCL's device as long as XCL used the default adapter too, and the D3D12.X checks passed. On a different adapter the title got a device XCL had never adopted: console shaders without a fallback, no IDXGIDevice, no placed title memory, and an access violation in D3D12Core.dll (5 of the title's D3D12.X checks failed). The title now looks both functions up in d3d12_xs.dll with LoadLibrary / GetProcAddress, which XCL serves from its HLE module.
Console GS and NGG programs are drawn through a mesh pass. On the RDNA2 iGPU, which has no mesh shader tier, four retail-pack tests failed with E_INVALIDARG at mesh pipeline creation: the ES+GS geometry draw, the GS and the MS pipelines through the hook, and the mesh half of the background-build test. They now check D3D12_OPTIONS7 on the backend's device and skip that part with a note; the VS / PS parts still run.
This was referenced Nov 22, 2026
Collaborator
|
Thanks, merged! I tested it on top of current
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.