Shaders: warm the graphics DXIL variants selected at runtime #2600

Open
opened 2026-11-26 05:34:41 +00:00 by github-bot · 0 comments
Owner

@⁠KOLESNiii on GitHub · 2026-11-26 01:18 UTC · original

Part of #2508 (Pipeline Rebuild). Reviewed on main at b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.

The folder and pack precompiler emits HLSL for VS/PS and calls DXC directly. Runtime PSO creation uses console_to_dxil_for, which can lower those stages directly with XCL_DIRECT_DXIL=all. The offline loop therefore never fills those direct-translation entries. In the HLSL path it also uses the default static-sampler base of zero. Runtime VS+PS creation passes the VS static-sampler count as the PS base, so a PS that uses static samplers can emit a different DXC input with its actual VS partner. Offline loop · Runtime VS/PS creation · Backend selection

Use the runtime translation path where the offline input identifies the same shader variant. For a raw PS record without its VS pairing, make the assumed sampler base explicit in coverage reporting. A regression test should cover direct VS/PS caching and an HLSL pair with a nonzero PS base. In a fresh process, verify hits for the warmed variants and measure translation/DXC separately from native PSO creation.

The remaining suspicion is that variant misses contribute to warm loading delays. The code establishes which paths differ. Windows timing and title frequency are unmeasured. Original roadmap comment

AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for static review and drafting.

**@⁠KOLESNiii** on GitHub · 2026-11-26 01:18 UTC · [original](https://github.com/xcl-dev/xcl/issues/2600) Part of #2508 (Pipeline Rebuild). Reviewed on `main` at `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. The folder and pack precompiler emits HLSL for VS/PS and calls DXC directly. Runtime PSO creation uses `console_to_dxil_for`, which can lower those stages directly with `XCL_DIRECT_DXIL=all`. The offline loop therefore never fills those direct-translation entries. In the HLSL path it also uses the default static-sampler base of zero. Runtime VS+PS creation passes the VS static-sampler count as the PS base, so a PS that uses static samplers can emit a different DXC input with its actual VS partner. [Offline loop](https://github.com/xcl-dev/xcl/blob/b49be18/crates/xcl/src/shaders.rs#L1673-L1707) · [Runtime VS/PS creation](https://github.com/xcl-dev/xcl/blob/b49be18/crates/xcl/src/hle/d3d12x/real.rs#L5206-L5232) · [Backend selection](https://github.com/xcl-dev/xcl/blob/b49be18/crates/xcl/src/gpu/recomp/pso.rs#L600-L615) Use the runtime translation path where the offline input identifies the same shader variant. For a raw PS record without its VS pairing, make the assumed sampler base explicit in coverage reporting. A regression test should cover direct VS/PS caching and an HLSL pair with a nonzero PS base. In a fresh process, verify hits for the warmed variants and measure translation/DXC separately from native PSO creation. The remaining suspicion is that variant misses contribute to warm loading delays. The code establishes which paths differ. Windows timing and title frequency are unmeasured. [Original roadmap comment](https://git.gtahub.st/github/xcl-dev--xcl/issues/1833) AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for static review and drafting.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:34:41 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.