Recompiler: route every shader stage through direct DXIL by default #3243
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3243"
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 Foniass on 2026-11-28T23:52:12Z.
Makes
XCL_DIRECT_DXIL=allthe default, as the maintainer asked: when the variable is unset, console compute, vertex and pixel shaders go through the direct DXIL translator. Each stage still falls back to the HLSL path on its own when the translator cannot handle it.XCL_DIRECT_DXIL=1keeps the compute-only routing, and a newXCL_DIRECT_DXIL=0restores the previous default (the HLSL path, plus the huge-program direct route).What is in it
crates/xcl/src/gpu/dxil/kernel.rs:enabled()/enabled_graphics()read the variable through onerouting()function (0none,1compute, anything else both), with a unit testdirect_dxil_all_is_the_defaultcrates/xcl/src/gpu/recomp/pso.rs: two comments that said "withoutXCL_DIRECT_DXIL" now say=0README.md: a "Shader translation" bullet for the new default and the0/1settingsTested
cargo test --workspace --no-fail-fast -- --test-threads=4onab375836: 2592 passed, 4 failed, 49 ignoredgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3:CreateComputePipelineStatereturnsE_OUTOFMEMORY(0x8007000E) on this card. They fail in the same way on main (227d2cb3), so this PR does not cause them.no wave64(32-lane GPU); alsotwo_pass_binds_set_the_shared_view_heap(no heap windows) andpso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache)s_barrier in a group of several hardware waves, 41 PS with a wave64v_writelanespill, and 11 PS reading lanes 32–63 in 32-lane waves.Regression run
main:
this PR:
Not tested
docs/specs/2026-11-24-direct-dxil.mdstill describes direct DXIL as behindXCL_DIRECT_DXIL=1/=all; this PR makes that statement out of date (not edited here)AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T03:04:50Z.
Source follow-up to the graphics direct-DXIL default on current
maind0832e61: a vertex shader's POS1 layer and viewport exports are missing from the direct path.setup_vertexdeclares position andrankedparameters, butrankedexcludes the layer and viewport system values.export_gfxthen ignores POS1 (TGT=13). The HLSL path emitsSV_RenderTargetArrayIndexandSV_ViewportArrayIndexfrom POS1.Z. This leaves direct DXIL without those outputs when a VS signature requests them.A bounded fix is to declare each requested system value as a scalar unsigned VS output and, when POS1.Z is enabled, write
z & 0x7fffor the layer and(z >> 16) & 0xffor the viewport. The existing POS1 fixture can be mirrored for the direct translator withz = 0x00030005: assert layer 5 and viewport 3, plus the absent-output and disabled-Z cases. A direct-DXIL-versus-HLSL draw with a layered render target would then check observable parity.This is a source finding; I have not run that regression or linked it to the AMD driver crash in #3544. AI use: Codex (GPT-6.2 Sol) traced the current path; Codex (GPT-6.2 Astra) independently checked the gap and the test shape.