From a129f2cb7fbf7b8aa48da39e8702b45d6bc64db7 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 26 Nov 2026 19:03:45 -0800 Subject: [PATCH] Runtime docs: a texture over a Shared buffer is settled as the whole buffer it lies over The runtime README's list of what a command buffer may write, which its completion flushes and invalidates, names every texture over a Shared buffer in an image of its own (and a pass's attachments, a binding, a use_resource write, a copy's destination, which may be such a texture) but did not say which bytes such a texture's settle covers. The code settles the whole buffer the texture lies over: TextureObject::shared_range (crates/metal2vulkan-runtime/src/texture.rs:5780) is its named buffer's BufferObject::shared_range (buffer.rs:654, the buffer's whole span), and coherence::Ranges::of (coherence.rs:212) adds that range to what is written for a texture in an image of its own. The list now says so, in one clause. Docs only; nothing narrowed. Verified: fmt --check and rustdoc -D warnings in the job that follows. --- crates/metal2vulkan-runtime/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-runtime/README.md b/crates/metal2vulkan-runtime/README.md index b1c5d7d2c..ed9456792 100644 --- a/crates/metal2vulkan-runtime/README.md +++ b/crates/metal2vulkan-runtime/README.md @@ -560,8 +560,9 @@ at these points: interface writes, a resource it declares with `use_resource` for writing, a render pass's attachments and resolve targets, a visibility result buffer, a synchronize's buffer, the whole Shared memory of every heap it uses, and every texture over a Shared buffer in an image - of its own. The flush comes first because Vulkan leaves a range undefined when the host wrote - it and it is invalidated without a flush. + of its own. A texture over a Shared buffer among these counts as the whole buffer it lies over, + not only its own bytes in it. The flush comes first because Vulkan leaves a range undefined when + the host wrote it and it is invalidated without a flush. - Around its own host accesses: the bytes `Texture::replace_region` stages are flushed before their copy, and so are the bytes `Texture::upload_region` copies from a Managed texture's named buffer, at the call; the bytes a copy stages for `Texture::get_bytes` are flushed and