shader: lower gfx1030 comparison sample gradients #2740
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2748"
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-26T05:44:20Z.
Summary
Lower gfx1030
image_sample_c_d,image_sample_c_d_o,image_sample_c_d_g16, andimage_sample_c_d_o_g16toSampleCmpGrad. This subset accepts a two-mip 2DR32_FLOATview, reddmask:0x1, a normalized point-comparison sampler and contiguous address operands. Gradients must be statically known and normal or zero in the input precision. G16 places U in the low half and V in the high half of each slope word. The offset forms accept a known packed signed XY displacement. Dynamic slopes, unwaited reads, unsupported sampler states and instruction LOD clamps remain refused.Follows #1568, which is already on main. Physical GPU readbacks for all four forms (and comparison LOD bias) have now been reproduced on AMD Radeon RX 7900 XTX and AMD Radeon(TM) Graphics with the D3D12 debug layer enabled (see below).
Verification
Tested clean head
72f443fb13a9d47f421b2e20d02bec89a292aee6.All four commands passed. The new binary check exercised LLVM code generation, assembly, disassembly and the synthetic-container CLI for all four forms. The translated HLSL was also compiled and drawn through the WARP fixture below.
CTest: 17 passed, 0 failed, 2 capability skips. Windows 11 build
26300.9974, WARP10.0.26100.9818, Intel Arc B390 driver32.0.101.8509, D3D12 debug layer unavailable. All four forms matched the CPU reference on WARP at 8x8 and 16x16. Zeroing the gradient forimage_sample_c_dfirst changed pixel(2,0)from(1,0.578125,0.5,1)to(0,0.578125,0.5,1)in the 8x8 case. The WARP record counts all four forms; the targeted suite covers 27/111 gfx1030 MIMG forms, not the main-branch total. All four standalone Python checks passed.Arc B390 reported
SampleCmpGradientAndBiasSupportedunavailable, skippingpixel_aot_compare_grad_hardwareandpixel_aot_compare_lod_bias_hardware.Physical GPU verification on
72f443fb13a9d47f421b2e20d02bec89a292aee6(AMD)Built clean head
72f443fb13a9d47f421b2e20d02bec89a292aee6on Windows 11 build10.0.26200.9974with MSVC19.44.35228.0, DXC1.8.2502.11, and Python3.12.10(out/pe-env). D3D12 debug layer was enabled on all adapters (debug_errors=0 debug_warnings=0).compileand all 4 parallel checks (docs_links_check.py,bidi_controls_check.py,form_coverage_check.py,pixel_compare_grad_check.py) passed. (binaryandglslchecks were not rerun here as LLVM 15 and glslang/spirv-tools are not installed on this Windows host; both passed in the Linux run above.)1002:744c, driver32.0.32029.2010) + WARP (10.0.26100.9818): 19 passed, 0 failed, 0 capability skips (pixel_aot_compare_grad_hardwarepassed in10.59 s,pixel_aot_compare_lod_bias_hardwarepassed in5.62 s,pixel_aot_compare_grad_warppassed in5.45 s). Targeted coverage from this run: 49/1863 gfx1030 forms (27/111 MIMG forms).1002:164e, driver32.0.21045.29003): 2 passed, 0 failed, 0 capability skips (pixel_aot_compare_grad_hardwarepassed in7.75 s,pixel_aot_compare_lod_bias_hardwarepassed in5.69 s).image_sample_c_d,image_sample_c_d_o,image_sample_c_d_g16,image_sample_c_d_o_g16) matched the CPU reference at 8x8 and 16x16 (mismatches=0,debug_errors=0 debug_warnings=0). Zeroing the gradient forimage_sample_c_din the 8x8 case first differed atx=2 y=0:expected=1,0.578125,0.5,1 actual=0,0.578125,0.5,1(mismatches=21).git diff --checkand the local merge simulation passed against upstream1ec01d7037d30fbdc383d48dceb43ad8c48e0f0b. Merge simulation is separate from the tests above.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:12:08Z.
Review: COMMENTED
Review of head
c3cf49ff(after update with main).image_sample_c_d,_d_o,_d_g16,_d_o_g16toSampleCmpGradreads correct: address width, operand order, static-gradient and normal-or-zero guards, G16 low/high split, refusal of dynamic slopes.pixel_aot_compare_grad_{warp,hardware}added next to the sample/lod ones, CI workflow lists the new checks and installs glslang-tools.git diff --check origin/main...HEAD,tests/docs_links_check.py,tests/bidi_controls_check.py,tests/pixel_compare_grad_check.py glsl ...all pass.glslmode of the Linux check; only the draw test (WARP readback) can guard that.No blocking findings.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:12:07Z.
Win2025 WARP receipt for head
c3cf49ffafter updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
c3cf49ff20491ec95097c5bbcc875a8f14b23c73:--preset dev):cmake --build --preset dev --target offscreen_check -- -j 2):22.07s(configure1.82s)ctest --preset dev -R '^pixel_aot_(compare_(grad|lod_(level|bias)|sample)_(warp|hardware)|sample_(gradient|coarse_gradient)_(warp|hardware))$' --parallel 6 --no-tests=error --output-on-failure): 12/12 passed (6.09s:pixel_aot_compare_lod_level_warp1.89s,pixel_aot_compare_lod_bias_warp1.94s,pixel_aot_sample_coarse_gradient_warp3.02s,pixel_aot_compare_sample_warp3.03s,pixel_aot_sample_gradient_warp3.03s,pixel_aot_compare_sample_hardware3.08s,pixel_aot_compare_lod_level_hardware1.99s,pixel_aot_compare_lod_bias_hardware1.97s,pixel_aot_sample_gradient_hardware2.75s,pixel_aot_sample_coarse_gradient_hardware2.80s,pixel_aot_compare_grad_hardware2.85s,pixel_aot_compare_grad_warp2.87s)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 2):43.15s(configure1.81s)ctest --preset release -R '^pixel_aot_(compare_(grad|lod_(level|bias)|sample)_(warp|hardware)|sample_(gradient|coarse_gradient)_(warp|hardware))$' --parallel 6 --no-tests=error --output-on-failure): 12/12 passed (5.62s:pixel_aot_compare_lod_bias_hardware1.75s,pixel_aot_compare_lod_level_hardware1.80s,pixel_aot_compare_lod_bias_warp1.82s,pixel_aot_sample_gradient_warp2.76s,pixel_aot_sample_coarse_gradient_warp2.82s,pixel_aot_compare_sample_warp2.83s,pixel_aot_compare_lod_level_warp1.79s,pixel_aot_compare_sample_hardware2.67s,pixel_aot_sample_gradient_hardware2.71s,pixel_aot_sample_coarse_gradient_hardware2.53s,pixel_aot_compare_grad_hardware2.66s,pixel_aot_compare_grad_warp2.67s)tests/pixel_compare_grad_check.pyok (0.5s),tests/pixel_compare_lod_check.pyok (0.5s),tests/pixel_sample_gradient_check.pyok (0.5s)sccache: 52/58 hits; wall81.5sTests run include pixel_aot_compare_grad_warp/hardware (the new one) plus the lod/sample/gradient siblings.
AI-assisted; commands listed were executed locally.