Files
metal2vulkan/docs
Anees Iqbal 0126e3adbc rt: a texture for views placed in a heap, by the heap texture's rule
Device::new_heap_texture_for_views(descriptor, heap, offset) is MTLHeap's
newTextureWithDescriptor:offset: for a texture reached through its views alone. It is the texture
Device::new_texture_for_views makes, with its image bound at offset in a Private heap range of a
block the consumer holds. Nothing is allocated, and the bytes are the ones the heap's memory holds
there, so nothing is zeroed. Its uses and its views' uses take the heap's id in the hazard sets,
and the texture holds the block. What differs from Metal is what differs for
new_texture_for_views: it has no index of its own.

Why: the consumer's cache shape images are textures for views. Until now they took rt's own
texture block or an allocation of their own, sometimes on the consumer's ring thread; one measured
24.6 ms for 34.5 MiB. With this call they come from the consumer's Private pieces, which it makes
ahead, so the consumer's pool stays the one place memory is made ahead.

How: one rule, not a second path. Device::heap_source is the heap check new_heap_texture made
inline: the block is the consumer's, and it is Private and not exported (Gap::HeapTexture
otherwise). Both new_heap_texture (Reach::Index) and the new call (Reach::Views) take their
Source::Heap from it into Device::texture, which binds it through Bind::Heap and heap_fit as
before. The README's texture-for-views entry, HeapRange's doc, and the docs of Gap::HeapTexture and
Refusal::HeapTexturePlace name the call. The signature table is re-blessed (one method added).
REFUSALS.md regenerates with heap_source as the refusal's site.

Test: tests::heap::every_device_places_a_texture_for_views_in_a_heap (device cfgs). In a heap
range of a Private block, the make moves neither Metrics::texture_allocations nor
texture_block_allocations, adds no block and no texture block, and the texture answers index 0.
A view's replace_region is read back by the texture's get_bytes, and the texture's write is read
back by the view's. A placement off the image's alignment is Refusal::HeapTexturePlace, and a
Shared block's heap is Gap::HeapTexture.

Verified: cargo fmt, signatures.py --check. The clippy, lavapipe and GPU runs follow in potluck
jobs.
2026-11-19 10:08:35 -08:00
..