Direct DXIL: image_get_lod accepts static samplers #1806
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1806
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1806/head"
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?
@bmjask on GitHub · 2026-11-24 20:57 UTC · original
bmjask:dxil/coverage-full→main· +67 −25 · 3 files · 1 commits · merged 2026-11-24 21:13 UTCFollow-up to #1426.
image_get_lodwith a static sampler (an S# built from constants in the shader) fell back to HLSL;Lw::mimg_samplerincrates/xcl/src/gpu/dxil/lower_image.rsnow resolves it the same way sampling does, which fixes 79 a retail title pixel shaders. With that, every program in the pack translates directly except geometry shaders (geometry mode is in #1679). The sweep report also lists the 10 slowest programs.What is in it
Lw::mimg_sampler:image_get_lodaccepts static samplers, sharing thes<i>, space1binding with samples of the same S#.Regression test
core_tests::ps_get_lod_with_a_static_sampler(translates, one shared static sampler, validates).Sweep report: the 10 slowest programs.
Full-pack sweep (26,698 programs):
total 26,229 (98.2%) → 26,308 (98.5%)
PS 12,022 → 12,101 / 12,101; CS/MS/VS 100%; GS 0/390 (#1679)
0 validator failures, panics, or timeouts
translation p50/p95/max: 84 ms / 1.29 s / 20.4 s → 50 ms / 0.86 s / 17.9 s (depends on machine load)
size on a 1,500-program sample: direct 218.3 MB vs HLSL+DXC 174.1 MB (1.25×)
Tested
RTX 4090, i9-12900K, Windows 11, rustc 1.100.0, debug + release
cargo test --workspace -- --test-threads=4: 892 passed, 0 failed, 42 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows))gpu::dxil: 83 passed, 0 failed;gpu::recompwithXCL_DIRECT_DXIL=1: 197 passed, 0 failed; withXCL_DIRECT_DXIL=all: 197 passed, 0 failedRegression run
main:
PR:
Not tested
Geometry shaders (they need #1679).
Other GPU vendors.
AI use
🤖 Generated with Claude Code
@thehollowedone on GitHub · 2026-11-24 21:03 UTC · original
Tested
On
7a84e7a, I drew a synthetic 16×16 target withIMAGE_GET_LODandIMAGE_SAMPLEsharing one static sampler. The fixture bound that sampler through XCL’s D3D12 root-signature helper and supplied no heap samplers. Both draws matched HLSL exactly across all 256 pixels each and matched the expected values for the four-mip texture.RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11.
cargo test --offline --locked -p xcl --lib <filter> -- --nocapture --test-threads=1passed 1/1 each for the stockps_get_lod_with_a_static_samplerand the localscratch_gpu_static_sampler_lod_matches_hlslfixture, with zero skips. Replacing only the image lowering file with the base revision made the same fixture fail at translation withimage_get_lod with a static sampler.Not tested
This was a focused synthetic pixel-shader test. No whole-suite run, retail smoke, or other GPU vendors in this check.
AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the local fixture and drafted this report.
@Flyander on GitHub · 2026-11-24 21:04 UTC · original
One complement to the translation-only regression: #1775 exercised
image_get_lodwith a static sampler end to end in a synthetic pixel draw on an RTX 5070 Ti, checking clamped LOD 0 and unclamped LOD -2. I am closing #1775 to avoid duplicating this implementation. Its runtime harness and GPU test (runner.rs,recomp/tests.rs) could be a focused follow-up after this translator change lands. I have not run that test against this PR head.