From a720be9cf518b74212b8ae8a73fe2f4d2b4e092d Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 4 Nov 2026 23:21:10 -0800 Subject: [PATCH] Read an overflowed buffer's placement only where it lies in the runtime's own pages own_pages_overflowed went through OwnBytes::with, which for a buffer over host pages reads them for ReadApart::Binding and keeps the import for good; every program buffer is now asked, so that would be a side effect on each. It now reads Lie::Fixed pages only, as in_fresh_pages does: host pages are imported and never overflow. Verified: nothing yet (cargo fmt only). (cherry picked from commit 77702ceef4f18d30cfe32499fd3be25729e49bcb) --- crates/metal2vulkan-runtime/src/buffer.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/buffer.rs b/crates/metal2vulkan-runtime/src/buffer.rs index e8f4f8fdb..29f759496 100644 --- a/crates/metal2vulkan-runtime/src/buffer.rs +++ b/crates/metal2vulkan-runtime/src/buffer.rs @@ -2807,14 +2807,15 @@ impl Buffer { } /// Whether the buffer's own pages, of the runtime's memory, overflowed past device-local memory - /// into system memory (`memory.rs`'s `overflow_candidates`); false for a heap's buffer, whose - /// bytes are its heap's. + /// into system memory (`memory.rs`'s `overflow_candidates`): false for a buffer over host + /// pages, which are imported, and for a heap's buffer, whose bytes are its heap's. pub(super) fn own_pages_overflowed(&self) -> bool { match &self.0.bytes { - Bytes::Own(own) => own.with(ReadApart::Binding, |pages| { - pages.memory.placement.overflowed() - }), - Bytes::Heap(_) => false, + Bytes::Own(OwnBytes { + lie: Lie::Fixed(fixed), + .. + }) => fixed.pages.memory.placement.overflowed(), + Bytes::Own(_) | Bytes::Heap(_) => false, } }