mirror of
https://github.com/italicsjenga/portability.git
synced 2024-11-26 08:51:31 +11:00
Fix flush and invalidate ranges
This commit is contained in:
parent
07fc60dad9
commit
cc049bbb7c
|
@ -839,7 +839,15 @@ pub extern "C" fn gfxFlushMappedMemoryRanges(
|
|||
slice::from_raw_parts(pMemoryRanges, memoryRangeCount as _)
|
||||
}
|
||||
.iter()
|
||||
.map(|r| (&*r.memory, r.offset .. r.offset + r.size));
|
||||
.map(|r| {
|
||||
let range = if r.size == VK_WHOLE_SIZE as VkDeviceSize {
|
||||
(Some(r.offset), None)
|
||||
} else {
|
||||
(Some(r.offset), Some(r.offset + r.size))
|
||||
};
|
||||
|
||||
(&*r.memory, range)
|
||||
});
|
||||
|
||||
gpu.device.flush_mapped_memory_ranges(ranges);
|
||||
VkResult::VK_SUCCESS
|
||||
|
@ -854,7 +862,15 @@ pub extern "C" fn gfxInvalidateMappedMemoryRanges(
|
|||
slice::from_raw_parts(pMemoryRanges, memoryRangeCount as _)
|
||||
}
|
||||
.iter()
|
||||
.map(|r| (&*r.memory, r.offset .. r.offset + r.size));
|
||||
.map(|r| {
|
||||
let range = if r.size == VK_WHOLE_SIZE as VkDeviceSize {
|
||||
(Some(r.offset), None)
|
||||
} else {
|
||||
(Some(r.offset), Some(r.offset + r.size))
|
||||
};
|
||||
|
||||
(&*r.memory, range)
|
||||
});
|
||||
|
||||
gpu.device.invalidate_mapped_memory_ranges(ranges);
|
||||
VkResult::VK_SUCCESS
|
||||
|
|
Loading…
Reference in a new issue