Shaders: support clamped image sample variants and include cubemap kinds in spatial count #1255
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1255
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1255/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?
@AdamRchd on GitHub · 2026-11-24 16:49 UTC · original
AdamRchd:fix/clamped-image-samples→main· +114 −22 · 1 files · 1 commits · closed without mergingWhat
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.
@pablogonz12 on GitHub · 2026-11-24 17:03 UTC · original
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.
@AdamRchd on GitHub · 2026-11-24 17:15 UTC · original
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.@Marvisak on GitHub · 2026-11-25 00:35 UTC · original
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