shader: test folded inline sampler masks #1268
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1275"
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 Jess-Doit on 2026-11-24T06:28:38Z.
Refs #1149
Add a source-built gfx1013 pixel fixture for inline sampler words built with
s_bfm_b32. The pure check compares all four words in thesmpline againstthe assembly's masks, including width and offset masking and a zero-width mask.
Overwriting a folded word with a width from a root constant is refused by the
current translator. In a local mutation that retained the old constant, the
check failed as expected.
The desktop draw feeds the manifest line through the stand-in's shared sampler
parser, decoder, and root-signature builder. At x=1.25 the clamp sampler reads
column 1 (
3e800000,3f800000,00000000,00000000). Keeping the shader, texture,and expected pixel fixed and switching to the folded wrap words must mismatch
and read column 0 (
3e000000,00000000,00000000,00000000).The draw reuses
--startup-image-3d, which now takes an optional sampler manifest line.tests/startup_image_3d.cppbuilds its root signature with the stand-in'screate_translated_rootinstead of a hand-written point-wrap sampler; without the extra argument it readssmp 0 0x0 0x0 0x0 0x0, which decodes to the same point-wrap sampler, andstartup_image_3d_*still pass.Verification
Tested commit
a39c5849e5caab3d9a853e6f6f2b65868c809dc5on basef1b16abd266144c4ec3517fb989060a4ee7a50ce. Debug and Release each passed13 tests with 0 failures and 0 skips, including the existing 3D, explicit LOD,
and sampler heap checks. Both DXC
ps_6_0and FXCps_5_1produced theexpected clamp and wrap readbacks on Windows 10 22H2 (19045.6456) with the
GTX 1060 6 GB (32.0.15.6094) and in-box WARP (10.0.19041.5794). The D3D12
debug layer reported zero errors and warnings in all new draw cases. Local
LLVM 23.1.6 reassembled all three programs byte-for-byte. The CI reassembly
step uses LLVM 15.
The follow-up commit
c641d1b6only adds the new check to the pure-Python list inAGENTS.md.AI-assisted (Codex).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:44:32Z.
Review: COMMENTED
Peer review at commit
c641d1b6ec6aafaa00beb0e0b69c0d46835c3838:Findings
tests/startup_inline_sampler_check.py: Clean pure translation, binary reassembly, and D3D12 draw coverage for foldeds_bfm_b32inline sampler masks (5-bit width/offset masking, zero-width mask, root-constant overwrite rejection viaG.Unsupported, and clamp vs wrap readback control).tests/startup_image_3d.cpp,tests/offscreen_check.cpp,tests/desktop_gpu.h: Reuses--startup-image-3dwith an optional sampler manifest line (defaulting to"smp 0 0x0 0x0 0x0 0x0") and switchescreate_roottox2w_startup::create_translated_root, keepingstartup_image_3d_warppassing.CMakeLists.txt,.github/workflows/windows.yml,AGENTS.md,docs/startup-runtime.md: Wiresstartup_inline_sampler_controls,startup_inline_sampler_{warp,hardware}(SKIP_RETURN_CODE 77), and Linux CI checks cleanly.Verification
git diff --check origin/main...HEAD: clean/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (Checked 16 Markdown files and 284 links)/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (Checked 1066 tracked source, script and build/CI files: no bidirectional controls)/root/.local/share/x2w-rev-venv/bin/python -B tests/startup_inline_sampler_check.py: passed (clamp,wrap, and root-constant mask width refusal)/root/.local/share/x2w-rev-venv/bin/python -B tests/startup_inline_sampler_check.py binary /usr/lib/llvm-19/bin/llvm-mc: passed (all three fixture programs match llvm-mc)--preset dev):cmake --build --preset dev --target offscreen_check -- -j 6(20.47s)ctest --preset dev -R '^startup_(inline_sampler_(controls|warp)|image_3d_warp)$' --parallel 4 --no-tests=error --output-on-failure: 3/3 passed (0.83s:startup_inline_sampler_controls0.16s,startup_inline_sampler_warp0.45s,startup_image_3d_warp0.77s)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 6(20.83s)ctest --preset release -R '^startup_(inline_sampler_(controls|warp)|image_3d_warp)$' --parallel 4 --no-tests=error --output-on-failure: 3/3 passed (0.83s:startup_inline_sampler_controls0.16s,startup_inline_sampler_warp0.45s,startup_image_3d_warp0.76s)Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T07:27:44Z.
Merged
main(dc73c29e) as0ba01c03. The conflicts were all with #1262, now onmain: the CI, AGENTS.md and CMake lists,desktop_gpu.h, and theoffscreen_checkoperation table. Both sides are kept. Againstmain, this branch's diff is unchanged.Retest on Windows 10 22H2
19045.6456, GTX 1060 6 GB (driver32.0.15.6094) and in-box WARP, Debug build,X2W_D3D12_DEBUG=1:9/9 passed:
startup_inline_sampler_*,startup_image_3d_*andstartup_flat_param_*.Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T07:44:41Z.
Merged
main(a73e3362). The only conflict was inCMakeLists.txt, wherestartup_xg_bc_tilingand this PR'sstartup_inline_sampler_*tests are registered in the same place; both are kept. CMake configures and lists both. No code changed, and againstmainthis branch's diff is unchanged, so the retest above still applies.upstream-sync referenced this pull request2026-11-25 13:00:54 +00:00