shader: read the split Texture2DArray comparison sampler back on the GPU #1100
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1107"
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-24T01:07:27Z.
Change
Follow-up to #1079, which split shared comparison samplers on
Texture2DArrayimages and left the arrayed module's DXC compile and GPU readback for a Windows run.tests/spirv_window/compare_sampler.cpp: anarray/array-<variant>descriptor variant makes t0 and t1 two-layerTexture2DArrayresources with explicit array SRVs. Layer 1 differs from layer 0 in every texel the shader reads: depth 0.875 (both comparisons pass), ordinary 0.3125, mip 1 0.5625.tests/spirv_window/compare_sampler.py: a layer-1 copy of the arrayed module (coordinate(0.25, 0.25, 1)). DXC must still reject the unsplit arrayed module and compile both split ones. Readbacks of layer 0, layer 1, layer 1 against layer 0's reference, and the comparison and ordinary sampler controls on layer 1.docs/experiments.md: describe the arrayed GPU stage.The existing
Texture2Ddraws and their controls are unchanged.Verification
Tested
f38773dc(onea0e838e) on Windows 10 22H219045.6456with a GTX 1060 6GB (10de:1c03, driver32.0.15.6094) and in-box WARP (1414:008c,10.0.19041.5794). The D3D12 debug layer was enabled on both.Each preset passed 2/2 (
spirv_compare_sampler_hardware,spirv_compare_sampler_warp) with zero skips. Results were identical on both adapters:spirv-val --target-env vulkan1.2, arrayed shared + split, layers 0 and 1no matching member function for call to 'SampleLevel'(expected)cs_6_0, split arrayed module, layers 0 and 1Texture2Dreference3f800000,00000000,3ec00000, 0/16 mismatches3f800000,3f800000,3ea00000, 0/16 mismatchesGREATER00000000,00000000)MinLOD13f100000, not layer 0's3f200000)git diff --checkandtests/docs_links_check.pyare clean.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T02:15:40Z.
Review: COMMENTED
Reviewed at
18ef8ce7a760c46eb78d623cf6740298536eea94.tests/spirv_window/compare_sampler.cppcleanly extendscheck_spirv_compare_samplerwitharray/array-<variant>using two-layerTexture2DArraySRVs whose layer 1 differs in every sampled texel (depth0.875, ordinary0.3125, mip 10.5625).tests/spirv_window/compare_sampler.pyverifies DXC still rejects the unsplitshared_arrayHLSL, compileslowered_arrayandlowered_array_layer1, and checks layer 0 vs layer 1 readback pluscomparison-greater(words 0–1) andordinary-min-lod1(word 2 on layer 1's mip 1).python3 -B tests/docs_links_check.py(15 files, 253 links),python3 -B tests/bidi_controls_check.py(939 files),python3 -B tests/gpu_report_format_check.py(10 tests),python3 -B tests/xgameruntime_table_check.py,python3 -B tests/spirv_window/check.py, andpython3 -m py_compile tests/spirv_window/compare_sampler.py— all passed.Assemble and translate gfx1013 fixturespassed; the 2 Windows build/test checks are currently pending, so Windows DXC/WARP/hardware readback relies on CI.Imported from R0Y00/Xbox2Windows. Originally posted by Toons29 on 2026-11-24T02:04:25Z.
Tested
18ef8ce7on an AMD Radeon RX 9070 (RDNA 4,1002:7550), driver32.0.32029.2010, Windows 11 build 26300,devpreset, debug layer unavailable: passspirv_compare_sampler_hardwareandspirv_compare_sampler_warpboth pass, with no skips. On the RX 9070, the baseline, the comparison descriptor (00000000,3f800000,3ec00000), the ordinary MinLOD-1 descriptor (3f800000,00000000,3f200000) and array layers 0 and 1 all read back withmismatches=0over 16 words. Every control is caught: the wrong reference (1), comparison vs baseline (2), ordinary vs baseline (1), layer 1 vs layer 0 (2), array comparison vs layer 1 (2) and array ordinary vs layer 1 (1). The array layer 1 comparison readback is00000000,00000000,3ea00000.I first ran it at
f38773dc, before the main merge, and every readback above is the same at both commits.