Pin the SPIR-V sampler split's profile, interface, set and ID checks #978
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!978
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/978/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 19:34 UTC · original
Leyukaka:sps-controls→main· +26 −0 · 1 files · 2 commits · merged 2026-11-23 19:53 UTCChange
This closes eight gaps in the test coverage of
tools/spirv_sampler_split.py. Each is a one-statement mutation of the split that passesspirv_compare_sampler_warpandspirv_compare_sampler_hardwareonmain. Onlycontrols()intests/spirv_window/compare_sampler.pychanges; the split does not.-1:Ordinary sampler binding must be nonnegative< -1Fragment:requires a single GLCompute entry pointOpTypeImage:only non-array float32 Texture2D sampling is supported%cmpSamplerdropped from the entry-point interface:sampler must be listed in the entry-point interface%cmpSamplerin set 1 with ordinary binding 3, which set 0 already uses: the split succeeds and the new sampler is decorated set 1, binding 3DescriptorSet 0%x2w_plain_sampler_0ID:Reserved sampler split ID is already in use%x2w_plain_samplerOpCopyObject:loaded sampler feeds OpCopyObjectOpSampledImageconsumers of the loaded sampler skippedThe new rejection cases and the set-1 case are text-level; they derive from
shared_sampler.spvasmand callsplit_comparison_sampler()directly. No fixture file is added.Verification
On
453a251(based onmainat0bcda16), 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_split.pyone at a time and the twospirv_compare_sampler_*tests were run with themainand the branch versions ofcompare_sampler.py. With the unmutated split both pass. Onmain, both tests passed under all eight mutations; on this branch they fail under each of them.The eight edits to
tools/spirv_sampler_split.py:if ordinary_binding < 0:->if ordinary_binding < -1:if len(entries) != 1 or parsed[entries[0]][1] != "GLCompute":->if len(entries) != 1:texture[4:] != ["0", "0", "1", "Unknown"]->texture[5:] != ["0", "1", "Unknown"]if sampler not in parsed[entry][4:]:check and itsraiseremovedif descriptor_sets.get(variable, 0) == descriptor_set and slot == ordinary_binding:->if slot == ordinary_binding:OpDecorate {PREFIX} DescriptorSet {descriptor_set}->OpDecorate {PREFIX} DescriptorSet 0word.startswith(PREFIX)->word == PREFIXin the reserved-ID checkraisefor a non-OpSampledImageuse of the loaded sampler ->continueChecklist
AI-assisted.