Files
metal2vulkan/crates
Anees Iqbal 1d2dbcbfc5 RUNTIME 2365: Compute: an encoder's dispatch takes the device's sampler states only where it needs them
Every compute encoder dispatch that settled (no memo entry held) listed
every live sampler state of the device (argument_samplers_at: a lock,
an Arc clone of each, and their drop), though its kept bind state
already listed them at the count of their slots' changes that held, and
a variant with no set-1 arrays binds none of them. In the consumer's
profile of its GL fix-index encoder that listing was 4.7% of
dispatch_threads, beside the states' drop.

A compute encoder's dispatch now takes them as a draw does
(sampler::ArgumentSamplers): only where the kept listing is not of
every live state at the count that holds (then compared state by state,
as before), where the variant has set-1 arrays (fitted and written to
the heap, as before), where a notice names a state of pixel coordinates,
or where a parked memo entry of such a variant goes on in the next
encoder (restamp). SettledDispatch::argument_samplers is None where
none were taken; a heap dispatch without them is an internal error,
not a silent empty listing. The memo's count of slot changes is the
taken states' where it took them, else the one the kept listing holds
at.

WorkCounts::argument_samplers_taken now counts compute dispatches'
takes too (its doc says so); no new field, no new Degradation kind.

Verified: not yet built; the next job builds and tests it.

Verified (msi, lavapipe, m3-max-32979 at 421c3c4d65): clippy plain 0;
compute, dispatch, grid, region widths, partial threadgroups, flat
simdgroups, sampler, argument and heap trimmed tests 163/163, including
compute_sampler_listing (argument_samplers_taken moves only after a state
is made or goes; every dispatch's words are Metal's).
2026-11-15 10:13:12 -08:00
..