Files
metal2vulkan/crates
Anees Iqbal 32fe7f9fdf Neutral zero buffers: make one under the neutrals' lock, so threads that first ask at once share it
neutral_zero_buffer looked its length up under the neutrals' lock, let
go of it, made the buffer and took the lock again to insert it with
entry().or_insert(): threads that first asked for one length at once
each made a buffer, and every buffer but the inserted one was dropped
with its VkBuffer and its memory never released. The validation layer
reported it as VUID-vkDestroyDevice-device-05137 on lavapipe (Mesa
26.2.6) in runtime_lane::cache::makings_on_several_threads_each_read_
their_own_cache, whose cases make pipelines on several threads: a probe
that named each VkBuffer's creation site matched the leaked handle to
neutral.rs's vkCreateBuffer of the zero buffer (65536 bytes, uniform
and transfer-destination usage, on a maker thread).

The zero buffer is now made under the neutrals' lock, as the device's
neutral images and texel buffers already are (the same lock order:
neutrals, then memory and first moves). A new test releases eight
threads at once onto each of sixteen new lengths and requires one
buffer a length, handed to every thread. Verified on lavapipe in the
job named in the tip's report.

(cherry picked from commit d8143bf82fd959724985671ea8c17879166daf1c)
2026-11-07 06:59:35 -08:00
..