Device::new_sampler_state is newSamplerStateWithDescriptor: at an index of a live Sampler grant.
Each state takes the device sampler of each use it can be used in, from the translator's
metal::sampler::vk_sampler with its create info chained by ash_interop::sampler_create_info:
the plain one always, the comparison one where its compare function is not Never, and the
integer-texture one (nearest, the integer border colour). It writes them into set 1's three
sampler arrays at its index before the call returns; the comparison array keeps its default
where the state has no compare function.
Device samplers are shared by create info across uses and states (SamplerTable), and a border
colour no address mode reads is no part of a create info (canonical), so a state whose
integer-texture use reads as a plain sampler shares it: a nearest state takes one sampler, and a
linear compare state two more beside it. The table holds at most maxSamplerAllocationCount
minus the arrays' two defaults; past it a state is Limit::DeviceSamplers. Gauges::samplers and
Gauges::device_samplers count them. When the last handle goes, the state's elements read the
defaults again, its index is free, and each device sampler no other state holds goes to the
reaper (Free::Sampler).
A cubic filter is Gap::CubicSampler. samplerAnisotropy joins the floor's features (every lab
device and capture has it). SamplerState::gpu_resource_id is the index and the translator's
SamplerWord. IndexInUse and IndicesInUse now name sampler states too.
README: a "Sampler states" section and the floor's feature row. REFUSALS.md regenerated;
api_signatures blessed.
Verified:
- m3-max-42632 (msi), this tree: clippy of metal2vulkan-rt plain, --cfg m2v_gpu and --cfg
m2v_cpu_icd green; rustdoc -D warnings green; nextest 37 of 37; the device tests on lavapipe
under the validation layer 78 of 78, 0 validation errors.
- m3-max-42611 (780M, radv) and m3-max-42612 (3090), the same sampler change on the textures tip
before the rebase onto development, its archive under the validation layer: 75 of 75 each, 0
validation errors; every gauge zero at drop.
- `python3 scripts/api-signatures/signatures.py --check` and
`python3 scripts/refusal-surface/refusal_surface.py --check` clean.