shader: lower gfx1030 2D comparison sampling offsets #1480
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1487"
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 R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T12:47:01Z.
Summary
Lower gfx1030
image_sample_c,image_sample_c_o, andimage_sample_c_lz_oin the pixel AOT translator for a single 2DR32_FLOATview and a comparison sampler. Implicit forms require quad-provenance UVs and a zero source LOD range, with desktop maximum LOD zero or a one-mip view. Offset forms decode two signed six-bit fields and require the DXIL immediate range[-8, 7]. The contiguous address is optional offset, reference, then UV. The existing explicit-zero NSA path is unchanged.Replays only the comparison sampling patch from stan495/Xbox2Windows#12. The ordinary offset parent, #1451, has merged. Related to #1471, which covers a separate gfx1013 startup translation and sampler binding path; neither PR depends on the other.
Verification
Tested clean head
d34ee740ad0edbad234e64427b6c0ef59d7272e6.CTest: 12 passed, 0 failed, 0 skipped. Both passing comparison sample records contain all three new gfx1030 forms. The translated DXIL matches independent point and bilinear CPU references over the full 8x8 and 16x16 targets. With
(1,-2)incorrectly replaced by zero, both offset forms first differ at(3,0), channel 0 (1expected,0actual) at size 8. The size 16 bilinear control first differs at(5,0)(0.25expected,0actual). Rejections include missing quad provenance, a nonzero maximum LOD, unsupported offsets, masks and address forms, and an outstanding destination write.Windows 11 build
26300.9974; Intel Arc B39032.0.101.8509; Microsoft WARP10.0.26100.9818. Debug layer unavailable on both backends.LLVM 15 round-trips all three forms and verifies the synthetic-container CLI emits matching HLSL.
git diff --check origin/main...HEADpassed.git merge-tree --write-tree origin/main HEADpassed against5065b57450c19208a6199ae347d5ba6c057020b3; a separate simulation with #1485 applied first also passed. No integrated GPU test run is claimed.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:57:39Z.
Review: COMMENTED
Reviewed at commit
d34ee740ad0edbad234e64427b6c0ef59d7272e6:Code & Diff Audit
tools/pixel_aot.py: cleanly extractssample_offset_arg()so plain and comparison sampling share packed 6-bit offset decoding,[-8, 7]bounds checking, andvmcnthazard validation. Extending comparison sampling toimage_sample_c,image_sample_c_o, andimage_sample_c_lz_oproperly enforces contiguous addresses for the new forms,MAX_LOD 0and quad-provenance UVs (address[1:]after popping the offset) for implicit-LOD forms, and emitsSampleCmpvsSampleCmpLevelZerowith optionalint2(x, y).tests/pixel_compare_sample_check.py: validates all three forms against independent point and bilinearFraction-based CPU references and covers negative controls (missing quad provenance, nonzeroMAX_LOD, non-canonical/out-of-range/unknown offsets, NSA on new forms,dmask:0x2,a16, and outstandingvmcntwrites).origin/main.Verification
tests/docs_links_check.py(16 files, 335 links),tests/bidi_controls_check.py(1,219 files),git diff --check origin/main..HEAD, andpython3 -B tests/pixel_compare_sample_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.soall passed (Three gfx1030 2D comparison sample forms checked).tests/form_coverage_check.pypassed (42.99s).--preset dev):ctest --preset dev -R '^pixel_aot_(compare_sample|compare|sample_offset|sample_lod|dmask|get_lod)_(warp|hardware)$'12/12 passed (26.27s, includingpixel_aot_compare_sample_warp4.63sandpixel_aot_compare_sample_hardware5.37s)./O2(--preset release): same filter 12/12 passed (26.27s, includingpixel_aot_compare_sample_warp4.50sandpixel_aot_compare_sample_hardware5.15s).