shader: lower four gfx1030 pixel sample offset forms #1451
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1451
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1451/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?
@stan495 on GitHub · 2026-11-24 11:46 UTC · original
stan495:codex/gfx1030-mimg-sampling→main· +250 −16 · 6 files · 1 commits · merged 2026-11-24 12:29 UTCSummary
Lower
image_sample_o,image_sample_b_o,image_sample_l_oandimage_sample_lz_oon a single 2D RGBA texture. These forms take a statically known packed XY DWORD before the existing address operands. The lowerer sign-extends both six-bit components and checks the DXIL immediate range[-8, 7]. The profile uses matching texture and sampler state, integer mip levels for offset sampling, contiguous FP32 addresses anddmask:0xf.The pixel container entry point accepts
--cpu gfx1030and uses wave64 for decoding, including the internal two-exit control-flow check. The default gfx1013 path is unchanged.Verification
Tested clean head
772ac100a416a4c7c5280ce64364960d34d0c971.CTest reported 6 passed, 0 failed, 0 skipped. The WARP and physical runs compared translated DXIL against the CPU UV ramp across all exported channels and checked mip selection with a separate two-mip texture. All four new forms appear in each passing offset fixture's form record. The zero-offset mutant first differs at pixel
(0,0), channel 0, for all four forms (3d808000expected,00000000actual). Further mutations change level or bias to zero and replace explicit LOD zero with implicit sampling. Invalid masks, modifier bits, nonconstant offsets, out-of-range offsets and wrong sampler bindings are rejected.Windows 11 build
26300.9974, WARP Microsoft Basic Render Driver10.0.26100.9818, and Intel Arc B39032.0.101.8509. The debug layer was unavailable on both backends.LLVM 15 assembles and disassembles each gfx1030 source fixture. The pixel container CLI gives identical HLSL to the direct translator. The patch passed
git diff --checkandgit merge-tree --write-tree origin/main HEADagainste84829ded9ca2dff3710b879d37d28986b717cb6.@tedin7 on GitHub · 2026-11-24 12:06 UTC · original · reviewed
Dual-platform peer review at commit
772ac100a416a4c7c5280ce64364960d34d0c971.Audit
tools/pixel_aot.py&tests/pixel_sample_offset_check.py:image_sample_o,image_sample_b_o,image_sample_l_o, andimage_sample_lz_oon single 2D RGBA textures (dmask:0xf), popping the leading packed offset VGPR, checkingsample_dest(vmcnthazard), requiring a known canonical 2D word (packed & ~0x3f3f == 0), sign-extending the 6-bit X ([5:0]) and Y ([13:8]) fields, and enforcing the DXIL immediate range[-8, 7].--cpu gfx1030selects+wavefrontsize64,-wavefrontsize32for bothnative_programanddisassemble, leaving the defaultgfx1013path unchanged.0x8,0x3700), non-canonical packed words (0x10000,0x40), undefined/runtime offsets,vmcntoverlap,dmask != 0xf,SQ_RSRC_IMG_3D,a16/d16, and wrong sampler bindings.git diff --check origin/main..HEAD: clean.python3 tests/docs_links_check.py: passed (16 Markdown files, 325 links).python3 tests/bidi_controls_check.py: passed (1188 files).Linux Checks
python3 -B tests/pixel_sample_offset_check.py: passed (Four 2D sample offset forms checked).python3 -B tests/pixel_sample_offset_check.py binary llvm-mc-19 llvm-objcopy-19 /lib/x86_64-linux-gnu/libLLVM.so.19.1: passed.Verification on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)
--preset dev):cmake --build --preset dev --target offscreen_check -- -j 6):28.47sctest --preset dev -R '^pixel_aot_(sample_offset|sample_lod|dmask)_(warp|hardware)$' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (pixel_aot_dmask_warp3.86s,pixel_aot_dmask_hardware3.90s,pixel_aot_sample_lod_hardware4.11s,pixel_aot_sample_offset_hardware4.36s,pixel_aot_sample_lod_warp3.57s,pixel_aot_sample_offset_warp3.93s)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 6):40.87sctest --preset release -R '^pixel_aot_(sample_offset|sample_lod|dmask)_(warp|hardware)$' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (pixel_aot_dmask_hardware3.87s,pixel_aot_dmask_warp3.92s,pixel_aot_sample_lod_hardware4.09s,pixel_aot_sample_offset_hardware4.53s,pixel_aot_sample_lod_warp3.70s,pixel_aot_sample_offset_warp4.01s)tests/form_coverage_check.pyok (41.5s).