shader: lower explicit-level image sampling in sampled coverage #1343
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1350"
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 tedin7 on 2026-11-24T08:57:29Z.
Change
Lowers
image_sample_l(explicit level of detail) intools/sampled_coverage_aot.pytoSampleLevel(samp,uv,<level>). The level is the third address register,v[u:lod], and must be a register copied byv_mov_b32_e32 vN, sMfrom a buffered float that the program loaded and waited for. Inline constants, literals, vector or special-register sources, non-float scalars, the VOP3 move and a level that was never defined are refused, as are the sample forms already refused forimage_sampleandimage_sample_lz(tfe,lwe,a16,d16,r128,unorm,glc,slc,dlc, multi-channeldmask, 3D, 2D array,da, offset variants).docs/experiments.mdis updated. No existing lowering changes.This work was AI-assisted.
Verification
python3 -B tests/sampled_coverage_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM.so.19.1: exit 0 on Linux (LLVM 19; LLVM 15 not available locally).python3 -B tests/rdna2_tools_check.py: 138 tests OK (18 skipped).tools/sampled_coverage_aot.pyfrom origin/main fails (Unsupported coverage instruction v_mov_b32_e32). Mutating the new lowering to ignore the level, to emit the implicitSample, or to read the level from the wrong address register each makes the controls fail.image_sample_lprogram whose level word is 3 (past the single mip, so it clamps to mip 0).PR outside
--preset pr:sampled_coverage_warp.Evidence and follow-up
llvm-mcfor gfx1013.SampleLevelargument against distinct constants and requires it to equal the buffered word the load addresses, for four words and both textures;image_sample_lzand the implicit opcode must not read that word.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T09:02:15Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
7f3b070f43d3a8d1f9eecac38e59320d61df52ba:--preset dev):offscreen_checkbuild5.22s;ctest --preset dev -R '^sampled_coverage_warp$' --no-tests=error --output-on-failure: 1/1 passed (11.06s)/O2(--preset release):offscreen_checkbuild3.06s;ctest --preset release -R '^sampled_coverage_warp$' --no-tests=error --output-on-failure: 1/1 passed (10.78s)Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T09:02:25Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
7f3b070ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.