1
0
Fork 0
forked from wry/wry

vulkan: fix incoherent_range size calculation

This commit is contained in:
Julian Orth 2026-03-23 18:52:37 +01:00
parent 3659006417
commit 122e28139a

View file

@ -100,10 +100,12 @@ impl VulkanAllocation {
} }
fn incoherent_range(&self, mask: u64) -> MappedMemoryRange<'static> { fn incoherent_range(&self, mask: u64) -> MappedMemoryRange<'static> {
let lo = self.offset & !mask;
let hi = (self.offset + self.size + mask) & !mask;
MappedMemoryRange::default() MappedMemoryRange::default()
.memory(self.memory) .memory(self.memory)
.offset(self.offset & !mask) .offset(lo)
.size((self.size + mask) & !mask) .size(hi - lo)
} }
fn device(&self) -> &VulkanDevice { fn device(&self) -> &VulkanDevice {