VKMAPMEMORY(3)

NAME
vkMapMemory - Map a memory object into application address space.

C SPECIFICATION

    VkResult vkMapMemory(
        VkDevice                                    device,
        VkDeviceMemory                              memory,
        VkDeviceSize                                offset,
        VkDeviceSize                                size,
        VkMemoryMapFlags                            flags,
        void**                                      ppData);

PARAMETERS

device
    Logical device which owns the memory object.

memory
    A handle to the memory object to map.

offset
    Start offset of the memory region to map.

size
    Size of the memory region to map.

flags
    This parameter is reserved and must be zero.

ppData
    The pointer to a variable to receive the resulting application-visible address.

DESCRIPTION

vkMapMemory maps a region of the memory object specified in mem into application address space and returns the resulting pointer in the variable pointed to by ppData. The mapped memory region starts at offset offset and has a size of size. The flags parameter is reserved and should be set to zero.

VALID USAGE

    • device must be a valid VkDevice handle

    • memory must be a valid VkDeviceMemory handle

    • flags must be 0

    • ppData must be a pointer to a pointer

    • memory must have been created, allocated or retrieved from device

    • Each of device and memory must have been created, allocated or retrieved from the same VkPhysicalDevice

    • memory must not currently be mapped

    • offset must be less than the size of memory

    • If size is not equal to VK_WHOLE_SIZE, size must be greater than 0

    • If size is not equal to VK_WHOLE_SIZE, size must be less than or equal to the size of the memory minus offset

    • memory must have been created with a memory type that reports VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT

HOST SYNCHRONIZATION

    • Host access to memory must be externally synchronized

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

        • VK_ERROR_MEMORY_MAP_FAILED

SEE ALSO

vkUnmapMemory, vkFlushMappedMemoryRanges, vkInvalidateMappedMemoryRanges

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.