Shaders: lower gradient samples with an offset and LOD clamp #3493
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!3493
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3493"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-27 09:47 UTC · original
andrewpozdnakov7-jpg:codex2/gradient-sample-offset-lod-clamp→main· +120 −22 · 2 files · 1 commits · openimage_sample_d_cl_oalready decodes, butmainrefuses it during lowering. Route it to DXILsampleGrad, use the existing immediate-offset encoding, and take the LOD clamp after the gradient and coordinate operands. The current SM 6.6 path uses immediate offsets from -8 through 7. Cube gradient samples with an offset report an unsupported operation. Texture2D SampleGradThe synthetic regression samples a texture whose texels encode mip, row and column. Four dispatch cases combine mip 0 or mip 2 with zero offset or (+1, -1). All 32 lanes write to their own output dword. On
63bcca4the test stops at the unsupported opcode. On the patch, WARP reads the expected values 294, 263, 2066 and 2035 respectively.All 36 VALU tests and all 33 lowerer tests passed on the final commit. Strict shader Clippy passed with default and all features. Asset policy and git diff checks passed.
Independent testing on RTX 4090 Laptop (driver 621.14) and WARP passed all 32 lanes in each of ten dispatches on
48e796a, including offsets −8 and +7 and additional LOD clamps. The RX 5700 XT run on the combined follow-up102b5c2also passed all 16 cases. RTX and WARP report · RX 5700 XT reportRelated work on other sample and gather offset forms is in #1687. Synthetic textures and shaders only. AI-assisted with Codex.
@oddmaniv on GitHub · 2026-11-27 10:09 UTC · original
Independent verification of the PR author's concurrent WARP pipeline/draw test at
48e796ad3672d629050fba765e73baef68dc9e8c.cargo test --locked -p victory-shader --lib emit::host::tests::parallel_warp_pipelines_and_draws -- --exact --nocaptureMain baseline pin:
63bcca43c6a00a758510398fa43096ce7e4f7df0.Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits.
This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed.
AI-assisted verification.
@andrewpozdnakov7-jpg on GitHub · 2026-11-27 12:52 UTC · original
I tested #3493 together with #1687, #1256 and #2372 on current main (
63bcca4). The merge resolution at 102b5c2 preserves all four PR heads. It reads the offset from a whole VGPR and locates the LOD clamp after the independently packed gradients and coordinates. Both cube and cube-array gradient samples with an offset stop during translation.The expanded 2D fixture fails on main with
image_sample_d_cl_ounsupported. On the combined tree, app-local WARP 1.0.22 passed all 16 cases, checking all 32 lane writes per case. The matrix coversa16and_g16independently, offsets (0, 0) and (1, -1), and minimum LODs 0 and 2. The #1687 comparison-gather checks and #1256/#2372 cube readbacks also passed.Full shader suite on the combined tree: 333 passed, 4 failed, 3 ignored. Each of those four failures also occurs on main in the same WARP setup. All-target/all-feature shader Clippy with warnings denied and the asset policy passed.
If folding the added regression or the merge resolution into another commit, please retain Git authorship or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.AI-assisted with Codex. All shaders and textures were synthetic.
@ColorMeBoom on GitHub · 2026-11-27 15:07 UTC · original
AMD hardware run: RX 5700 XT (RDNA1), driver 32.0.21045.29003, Windows 11 26200, Rust 1.98.1. Head
48e796amerged ontomain63bcca4, no game files. So far this PR has only WARP reports.gradient_samples_apply_the_offset_at_the_clamped_mippasses on the hardware adapter and on WARP. Neither printed a skip, so both ran the per-clampassert_eq!over all 32 lanes.victory-shadersuite (--features host): 303 passed, 0 failed, 3 ignored.cargo clippy -p victory-shader --all-targets --features host -- -D warnings: clean.This is the PR alone. @andrewpozdnakov7-jpg's combined branch with #1687, #1256 and #2372 wasn't run here.
AI use: Claude Code (Claude Opus 5.5).
@andrewpozdnakov7-jpg on GitHub · 2026-11-27 15:31 UTC · original
Thanks @ColorMeBoom for checking
48e796aon the RX 5700 XT. The expanded case is in102b5c2under the same test name. If you have time for one more synthetic run on that card, please trycargo test --locked -p victory-shader --lib --features host gradient_samples_apply_the_offset_at_the_clamped_mip -- --nocapture. It checks all four coordinate/gradient packing combinations at two offsets and two clamped mip levels. Those 16 cases have passed on WARP here. Your run above covers the original PR fixture.@ColorMeBoom on GitHub · 2026-11-27 15:38 UTC · original
@andrewpozdnakov7-jpg ran it:
102b5c2as is (it already containsmain63bcca4), on the same RX 5700 XT, withVICTORY_WARPunset.cargo test --locked -p victory-shader --lib --features host gradient_samples_apply_the_offset_at_the_clamped_mip -- --nocapture: passed. Neither adapter printed a skip, so all 16 cases (4 coordinate/gradient packings × 2 offsets × 2 clamped mips) were checked on the hardware adapter and on WARP.victory-shadersuite on that tree (--features host): 337 passed, 0 failed, 3 ignored.cargo clippy -p victory-shader --all-targets --features host -- -D warnings: clean.AI use: Claude Code (Claude Opus 5.5).
@passerbyyhx on GitHub · 2026-11-27 18:56 UTC · original
Windows synthetic verification at
48e796ad3672d629050fba765e73baef68dc9e8c.On RTX 4090 Laptop (621.14) and WARP I read every lane of ten dispatches using the production shader lowering. All 32 lanes in each dispatch matched. The original four words were 294, 263, 2066 and 2035. On an interior coordinate the independent cases held the gradients fixed, changed the LOD clamp and exercised both immediate offset endpoints (−8 and +7). The three LOD pairs returned 4762/12317, 5650/13205 and 3745/11300 on both adapters. No debug-layer errors in the measured dispatches. Parent
63bcca43c6a00a758510398fa43096ce7e4f7df0declined this opcode during lowering at guest offset 104.Reproducible fixture. GTA-VI-3/EIGHT-20261127. AI-assisted with Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.