Pin the SPIR-V sampler view split's gather, multi-comparison and rejection paths #960
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!960
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/960/head"
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?
@Leyukaka on GitHub · 2026-11-23 18:48 UTC · original
Leyukaka:sampler-controls→main· +59 −0 · 1 files · 2 commits · merged 2026-11-23 19:17 UTCChange
This closes eight gaps in the test coverage of
tools/spirv_sampler_views.py. Each was a one-line mutation that passedspirv_sampler_views_warponmain. Onlytests/spirv_window/sampler.pychanges; the rewrite does not.The new cases run in the fragment-stage pass, whose ordinary sample is
OpImageSampleImplicitLod.OpImageDrefGatheras the comparison: rewrittenOpImageSampleDref*OpImageGatheras the ordinary use: comparison still rewritten, gather left on%siOpGroupDecoratepresent:unsupported indirect descriptor decorations%bridge_cmpID:comparison sampler view requires free descriptor set 3 and bridge_cmp IDsmainalready covers the set 3 half)unsupported depth-reference sampler provenance%samplersexpected undecorated sampler table at set 0 binding 1NonUniformEXTon the sampled image:unsupported decorated sampler pathEach rewritten comparison is also checked to load its sampler through
%bridge_cmp. A mutation that builds that pointer from%samplersalready fails onmainthrough the existing checks on the emitted module, so it is not counted above; the new assertion reports it directly. The new cases are text-only and are not assembled.Verification
On
e5b396d(branch on0f0c3eb), Windows 11 build 26300, MSVC 14.44.35207, Python 3.14, SPIR-V tools fromtools/setup-spirv-tools.ps1:All 16 tests pass. The eight
_hardwaretests ran on an NVIDIA GeForce RTX 5080 (driver 32.0.16.2101) and none was skipped.Each mutation was applied to
tools/spirv_sampler_views.pyone at a time andspirv_sampler_views_warpwas run with themainand the branch versions ofsampler.py. With the unmutated tool both pass. Onmain, the test passed under all eight mutations; on this branch it fails under each of them.The eight edits to
tools/spirv_sampler_views.py:for index, words in comparisons:->for index, words in comparisons[:1]:words[2].startswith("OpImage") and "Dref" in words[2]->words[2].startswith("OpImageSampleDref")startswith(("OpImageSample", "OpImageGather"))->startswith("OpImageSample")(["OpGroupDecorate"], ["OpDecorateId"])->(["OpDecorateId"],)if prefix in assembly or->if False orpointer[:3] != ["OpAccessChain", "%_ptr_UC_smp", "%samplers"]->pointer[:2] != ["OpAccessChain", "%_ptr_UC_smp"]if "OpDecorate %samplers Binding 1" not in bindings:("%samplers", words[4], image[3], sampler[2])->("%samplers", image[3], sampler[2])Checklist
AI-assisted.