Function vk_mem_alloc::ffi::vmaInvalidateAllocation
source · [−]pub unsafe extern "C" fn vmaInvalidateAllocation(
allocator: VmaAllocator,
allocation: VmaAllocation,
offset: DeviceSize,
size: DeviceSize
) -> Result
Expand description
\brief Invalidates memory of given allocation.
Calls vkInvalidateMappedMemoryRanges()
for memory associated with given range of given allocation.
It needs to be called before reading from a mapped memory for memory types that are not HOST_COHERENT
.
Map operation doesn’t do that automatically.
offset
must be relative to the beginning of allocation.size
can beVK_WHOLE_SIZE
. It means all memory fromoffset
the the end of given allocation.offset
andsize
don’t have to be aligned. They are internally rounded down/up to multiply ofnonCoherentAtomSize
.- If
size
is 0, this call is ignored. - If memory type that the
allocation
belongs to is notHOST_VISIBLE
or it isHOST_COHERENT
, this call is ignored.
Warning! offset
and size
are relative to the contents of given allocation
.
If you mean whole allocation, you can pass 0 and VK_WHOLE_SIZE
, respectively.
Do not pass allocation’s offset as offset
!!!
This function returns the VkResult
from vkInvalidateMappedMemoryRanges
if
it is called, otherwise VK_SUCCESS
.