Repository navigation
Conversation
A retail title's world has thousands of console mesh pipelines. The runtime builds each as two passes (`real::finish_two_pass`): a compute pass translated from the console MS and a pass-through mesh pipeline. `xcl shaders --precompile --pipelines` made only the CS pipelines, so every compute pass was compiled by the driver in-game, 3-9 s each. `--precompile` now treats an MS the runtime builds in two passes like a CS: it translates it through `pso::console_mesh_in` (the runtime's `console_mesh` with the memory windows given) with no pixel shader - the compute pass does not depend on it - so the DXIL is the one the runtime makes. With `--pipelines` the pass is built with XCL's ABI root signature and the pass's static samplers, under `XCL_PIPELINE_THREADS` and the `XCL_PIPELINE_MAX_KB` cap, and its driver blob is kept under `real::two_pass_compute_blob_path` (DXIL alone, no flags), the file `finish_two_pass` now reads through the same helper. `--only ms` builds those alone; `--sample N` stops after the first N programs `--only` lets through. `--used-only` passes the MSs over: a mesh pipeline's key includes its PS, so the MS alone does not identify it. In `finish_two_pass` the compute pass's blob is looked up before the huge-pipeline gate, and a pass with a blob no longer counts towards the gate's size: with a blob it is made in milliseconds. Not covered: the pass-through mesh pipeline depends on the title's PS and its blend / raster / depth state and target formats, so it cannot be precompiled and is still built by the runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested Independent debug check on clean
Both logged 20 native-wave64 skips, three per-lane f16/f32 refusals, unavailable driver-cache control and unavailable heap windows. The RTX 2080 SUPER also logged two tests skipped for the missing D3D12 debug layer.
The two workspace failures were Not tested Retail smoke, a full AI use Ran via Samaritan:
|
xcl shaders --precompile --pipelinesbuilt driver blobs for console compute shaders only. The compute pass of a console mesh shader (the two-pass path,real::finish_two_pass) was always compiled by the driver in the game. In the newer retail title (#505), whose world is drawn by thousands of console mesh pipelines, that was 3–9 s per pass on an RTX 5080, one at a time, while its draws were skipped. With this,--precompilemakes those passes too and keeps their blobs where the runtime looks for them. Part of #505.What is in it
crates/xcl/src/gpu/recomp/pso.rs:console_mesh_in(blob, ps, split, windows), the body ofconsole_meshwith the memory windows passed in;console_meshcalls it withmem_windows(), so the runtime is unchanged.crates/xcl/src/shaders.rs:--precompiletreats an MS the runtime builds in two passes like a CS. It translates it throughconsole_mesh_inwith no pixel shader (the compute pass does not depend on it, so its DXIL is the runtime's).--pipelinesit builds the pass with XCL's ABI root signature and the pass's static samplers, through the existingmake_with_cache_path(soXCL_PIPELINE_THREADSandXCL_PIPELINE_MAX_KBapply), and keeps the blob atreal::two_pass_compute_blob_path.--only msbuilds those alone.--sample Nstops after the first N programs--onlylets through.--used-onlypasses MSs over: a mesh pipeline's used key includes its PS, so the MS alone does not identify it.crates/xcl/src/hle/d3d12x/real.rs:two_pass_compute_blob_pathis the filefinish_two_passreads. The pass's blob is now looked up before the huge-pipeline gate, and a pass with a blob no longer counts towards the gate's size (it is made in milliseconds).README.md: the--only msline.shaders::tests::an_ms_compute_pass_is_precompiled_under_the_runtimes_key. For no split / 4 windows, split / 4 windows and split / heap windows: the precompiled DXIL and static samplers equal what the runtime builds with a PS, and the blob path equalstwo_pass_compute_blob_path.console_meshwithmem_windows()gives the same pass asconsole_mesh_in, and a CS and a PS are not taken for mesh shaders.Tested
stable-x86_64-pc-windows-msvc, release. On8d49cf1(this PR onmainc9a5d58before the README line was added; the head696a222differs only inREADME.md).cargo test --release -p xcl --lib shaders::: 10 passed, 0 failed, 0 ignored (the new test passed;pso_measurement_compiles_an_exact_synthetic_recordSKIPPED: the driver cache cannot be disabled without Developer Mode).cargo build --release --workspace && cargo test --release --workspace --no-fail-fast -- --test-threads=4: 1224 passed, 6 failed, 46 ignored.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3(CreateComputePipelineState: out of memory (0x8007000E)) fail onmainas well.gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translatorandhle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaafail the same way, run alone, on a cleanc9a5d58without this change.main): 18 "no wave64" (recomp::lower::tests×4,recomp::lower_dxil::tests×12,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware), 3 "refused by the per-lane form",heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record.xcl shaders <the title's shaders.rpf> --precompile --only ms --pipelines --sample 50: 50 compiled, 0 errors, 50 pipelines made, 0 refused, 8.1 s.main(where the title reaches its world), the same change made 9282 compute passes in 25 min (--only ms --pipelines). There, blobs that game runs had kept were found by the precompile under the same files (11 of the first 50), which shows that the two keys agree.Regression run
main:
this PR:
Not tested
--only msrun onmainitself.AI use
mainand ran the whole suite and the sample precompile.🤖 Generated with Claude Code