VKFLUSHMAPPEDMEMORYR(3)

NAME
vkFlushMappedMemoryRanges - Flush mapped memory ranges.

C SPECIFICATION

    VkResult vkFlushMappedMemoryRanges(
        VkDevice                                    device,
        uint32_t                                    memoryRangeCount,
        const VkMappedMemoryRange*                  pMemoryRanges);

PARAMETERS

device
    Logical device which owns the specified memory ranges.

memoryRangeCount
    Number of memory ranges described by pMemoryRanges.

pMemoryRanges
    Mapped memory ranges to flush.

DESCRIPTION

vkFlushMappedMemoryRanges flushes zero more more ranges of a mapped memory objects. device is a handle to the device that owns the memory objects to be flushed. memoryRangeCount is the number of ranges to flush and pMemoryRanges points to an array of memoryRangeCount instances of the VkMappedMemoryRange structure, each defining a region of memory to flush. The definition of VkMappedMemoryRange is:

    typedef struct VkMappedMemoryRange {
        VkStructureType    sType;
        const void*        pNext;
        VkDeviceMemory     memory;
        VkDeviceSize       offset;
        VkDeviceSize       size;
    } VkMappedMemoryRange;

For each element of the pMemoryRanges array, memory is the memory object containing the mapped range, offset is the location of the start of the range within memory, and size is the size of the region to flush. Both offset and size are specified in bytes.

If any referenced region of the memory object is not mapped or extends beyond the bounds of the memory object then the command has no effect on that region, but is still honored for other regions in the array. Multiple regions inside the same memory object may be contained in pMemoryRanges, including ranges that overlap one another.

Flushing memory ranges ensures that any writes performed by the host become visible to commands subsequently executing on devices with references to that memory. vkFlushMappedMemoryRanges has no effect with respect to writes performed by the device.

VALID USAGE

    • device must be a valid VkDevice handle

    • pMemoryRanges must be a pointer to an array of memoryRangeCount valid VkMappedMemoryRange structures

    • memoryRangeCount must be greater than 0

RETURN CODES

On success, this command returns

        • VK_SUCCESS

On failure, this command returns

        • VK_ERROR_OUT_OF_HOST_MEMORY

        • VK_ERROR_OUT_OF_DEVICE_MEMORY

SEE ALSO

vkMapMemory, vkUnmapMemory, vkAllocateMemory, vkFreeMemory

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.