Shaders: support clamped image sample variants and include cubemap kinds in spatial count #1255
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1255"
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 Marvisak/VIctory. Originally posted by AdamRchd on 2026-11-24T16:49:31Z.
What
In
crates/victory-shader/src/emit/lower.rs, image sample lowering now supports clamped image sample variants (image_sample_cl,image_sample_b_cl,image_sample_d_cl, andimage_sample_c_clin pixel shaders), passes the converted clamp argument instead of a dummy float, matchesimage_sample_b*when locating the initial address operand, and includes cubemap resource kinds (5..=7) in the spatial coordinate register count (spatial).Test
clamped_image_samples_lower_and_validateincrates/victory-shader/src/emit/lower.rscoveringimage_sample_cl,image_sample_b_cl, andimage_sample_d_cllowering and DXILValidatorchecks.cargo test -p victory-shader clamped_image_samples_lower_and_validate: passed.cargo test --workspace: passed (121 passed, 1 ignoredinvictory-shader; all workspace tests passed).cargo xtask policy:154 files ok.cargo run --release -p victory -- translate --validate:26148of26148programs translated (12167VS/PS,1417CS, and8152MS DXIL modules validated) with no_cllowering errors.No game files were included in the repository.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T16:56:54Z.
Review: APPROVED
Tested merged cleanly onto
main(ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):cargo test -p victory-shader emit::lower: 12 passed, 0 failed (includingclamped_image_samples_lower_and_validate)cargo clippy -p victory-shader --all-targets: 0 warningscargo xtask policy: okClean lowering and validation for clamped image sample variants and cubemap spatial counts. Approving.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-24T17:03:21Z.
Setup: Linux, RX 9070 XT, RADV (Mesa 26.3.1), dxil-spirv master, spirv-val 1.3. Your head folded onto a base of origin/main
ffe310eplus #1017 — main's host build is broken without it (E0425 host_resourceinvictory-gpu), so the base is that pair. Ran the four-stage offline check (translate, dxil-spirv, spirv-val, RADV pipeline) over 768 programs: the 751-program world dump plus a 52-program BVH capture, 35 duplicate containers skipped.No program gained or lost and the failure table is identical to the base, reason for reason: nothing in this capture reaches the class you lower, so this is a no-regression result only (same 10 SPIR-V validation failures as the base).
Not tested: in-game.
Imported from Marvisak/VIctory. Originally posted by AdamRchd on 2026-11-24T17:15:49Z.
Thanks for running the RADV check and confirming there are no regressions. Agreed—this capture doesn't hit
_clor cubemap spatial counts, so the unit test andvictory translate --validatecover the change here.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:35:40Z.
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.image_sample_d_cl is in main and the other _cl forms occur in no title program. Its cube change is wrong: it takes DXIL kinds 5..=7 as 'cubemap kinds' (6 and 7 are 1D/2D arrays) and passes a cube's two face-space gradients as two components of a direction gradient to sampleGrad. Also reformats unrelated tests.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed