Structures

VkImportNativeBufferInfoOHOS

Import memory from an Open Harmony OS hardware buffer

To import memory created outside of the current Vulkan instance from an Open Harmony OS native buffer, add a VkImportNativeBufferInfoOHOS structure to the pNext chain of the VkMemoryAllocateInfo structure. The VkImportNativeBufferInfoOHOS structure is defined as:

typedef struct VkImportNativeBufferInfoOHOS {
    VkStructureType sType;
    const void* pNext;
    struct OH_NativeBuffer* buffer;
} VkImportNativeBufferInfoOHOS;
  • sType is a VkStructureType value identifying this structure.
  • pNext is NULL or a pointer to a structure extending this structure.
  • buffer is a pointer to an OH_NativeBuffer structure.

A reference to the imported native buffer should be acquired by the implementation if the vkAllocateMemory command succeeds. Then the reference must release when the device memory object is freed. If the command fails, the implementation must not retain a reference.

Valid Usage (Implicit)

VUID-VkImportNativeBufferInfoOHOS-sType-sType

sType must be VK_STRUCTURE_TYPE_IMPORT_NATIVE_BUFFER_INFO_OHOS