From 122e28139adbaec6ceded73eb06c590156a5ed3e Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Mon, 23 Mar 2026 18:52:37 +0100 Subject: [PATCH] vulkan: fix incoherent_range size calculation --- src/gfx_apis/vulkan/allocator.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gfx_apis/vulkan/allocator.rs b/src/gfx_apis/vulkan/allocator.rs index c7fd5c1a..0cdffd0c 100644 --- a/src/gfx_apis/vulkan/allocator.rs +++ b/src/gfx_apis/vulkan/allocator.rs @@ -100,10 +100,12 @@ impl VulkanAllocation { } fn incoherent_range(&self, mask: u64) -> MappedMemoryRange<'static> { + let lo = self.offset & !mask; + let hi = (self.offset + self.size + mask) & !mask; MappedMemoryRange::default() .memory(self.memory) - .offset(self.offset & !mask) - .size((self.size + mask) & !mask) + .offset(lo) + .size(hi - lo) } fn device(&self) -> &VulkanDevice {