Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class ANDROIDExternalMemoryAndroidHardwareBuffer

extends Object
Class Inheritance
Imports
org.lwjgl.*, org.lwjgl.system.*

This extension enables an application to import Android AHardwareBuffer objects created outside of the Vulkan device into Vulkan memory objects, where they can be bound to images and buffers. It also allows exporting an AHardwareBuffer from a Vulkan memory object for symmetry with other operating systems. But since not all AHardwareBuffer usages and formats have Vulkan equivalents, exporting from Vulkan provides strictly less functionality than creating the AHardwareBuffer externally and importing it.

Some AHardwareBuffer images have implementation-defined external formats that may not correspond to Vulkan formats. Sampler Y′CBCR conversion can be used to sample from these images and convert them to a known color space.

VK_ANDROID_external_memory_android_hardware_buffer
Name String
VK_ANDROID_external_memory_android_hardware_buffer
Extension Type
Device extension
Registered Extension Number
130
Revision
5
Extension and Version Dependencies
VK_KHR_sampler_ycbcr_conversion and VK_KHR_external_memory and VK_EXT_queue_family_foreign and VK_KHR_dedicated_allocation
Contact
Other Extension Metadata
Last Modified Date
2021-09-30
IP Status
No known IP claims.
Contributors
  • Ray Smith, ARM
  • Lina Versace, Google
  • Jesse Hall, Google
  • Tobias Hector, Imagination
  • James Jones, NVIDIA
  • Tony Zlatinski, NVIDIA
  • Matthew Netsch, Qualcomm
  • Andrew Garrard, Samsung

Field Summary

Modifier and TypeField and Description
public static final String
public static final int
public static final int
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID

Extends VkExternalMemoryHandleTypeFlagBits.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
public static int
public static int
vkGetAndroidHardwareBufferPropertiesANDROID(VkDevice
the logical device that will be importing buffer.
device
,
long
the Android hardware buffer which will be imported.
buffer
,
VkAndroidHardwareBufferPropertiesANDROID
a pointer to a VkAndroidHardwareBufferPropertiesANDROID structure in which the properties of buffer are returned.
pProperties
)

Get Properties of External Memory Android Hardware Buffers.

public static int
vkGetMemoryAndroidHardwareBufferANDROID(VkDevice
the logical device that created the device memory being exported.
device
,
VkMemoryGetAndroidHardwareBufferInfoANDROID
a pointer to a VkMemoryGetAndroidHardwareBufferInfoANDROID structure containing parameters of the export operation.
pInfo
,
PointerBuffer
will return an Android hardware buffer referencing the payload of the device memory object.
pBuffer
)

Get an Android hardware buffer for a memory object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAMEback to summary
public static final String VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME

The extension name.

VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSIONback to summary
public static final int VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION

The extension specification version.

VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROIDback to summary
public static final int VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID

Extends VkExternalMemoryHandleTypeFlagBits.

VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROIDback to summary
public static final int VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID

Extends VkStructureType.

VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROIDback to summary
public static final int VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROIDback to summary
public static final int VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROIDback to summary
public static final int VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROIDback to summary
public static final int VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROIDback to summary
public static final int VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROIDback to summary
public static final int VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID

Extends VkStructureType.

Enum values:

Constructor Detail

ANDROIDExternalMemoryAndroidHardwareBufferback to summary
protected ANDROIDExternalMemoryAndroidHardwareBuffer()

Method Detail

nvkGetAndroidHardwareBufferPropertiesANDROIDback to summary
public static int nvkGetAndroidHardwareBufferPropertiesANDROID(VkDevice device, long buffer, long pProperties)

Unsafe version of: GetAndroidHardwareBufferPropertiesANDROID

nvkGetMemoryAndroidHardwareBufferANDROIDback to summary
public static int nvkGetMemoryAndroidHardwareBufferANDROID(VkDevice device, long pInfo, long pBuffer)

Unsafe version of: GetMemoryAndroidHardwareBufferANDROID

vkGetAndroidHardwareBufferPropertiesANDROIDback to summary
public static int vkGetAndroidHardwareBufferPropertiesANDROID(VkDevice device, long buffer, VkAndroidHardwareBufferPropertiesANDROID pProperties)

Get Properties of External Memory Android Hardware Buffers.

C Specification

To determine the memory parameters to use when importing an Android hardware buffer, call:


VkResult vkGetAndroidHardwareBufferPropertiesANDROID(
    VkDevice                                    device,
    const struct AHardwareBuffer*               buffer,
    VkAndroidHardwareBufferPropertiesANDROID*   pProperties);
Valid Usage
  • buffer must be a valid Android hardware buffer object with at least one of the AHARDWAREBUFFER_USAGE_GPU_* flags in its AHardwareBuffer_Desc::usage
Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

VkAndroidHardwareBufferPropertiesANDROID

Parameters
device:VkDevice

the logical device that will be importing buffer.

buffer:long

the Android hardware buffer which will be imported.

pProperties:VkAndroidHardwareBufferPropertiesANDROID

a pointer to a VkAndroidHardwareBufferPropertiesANDROID structure in which the properties of buffer are returned.

Annotations
@NativeType:VkResult
vkGetMemoryAndroidHardwareBufferANDROIDback to summary
public static int vkGetMemoryAndroidHardwareBufferANDROID(VkDevice device, VkMemoryGetAndroidHardwareBufferInfoANDROID pInfo, PointerBuffer pBuffer)

Get an Android hardware buffer for a memory object.

C Specification

To export an Android hardware buffer referencing the payload of a Vulkan device memory object, call:


VkResult vkGetMemoryAndroidHardwareBufferANDROID(
    VkDevice                                    device,
    const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
    struct AHardwareBuffer**                    pBuffer);
Description

Each call to vkGetMemoryAndroidHardwareBufferANDROID must return an Android hardware buffer with a new reference acquired in addition to the reference held by the VkDeviceMemory. To avoid leaking resources, the application must release the reference by calling AHardwareBuffer_release when it is no longer needed. When called with the same handle in VkMemoryGetAndroidHardwareBufferInfoANDROID::memory, vkGetMemoryAndroidHardwareBufferANDROID must return the same Android hardware buffer object. If the device memory was created by importing an Android hardware buffer, vkGetMemoryAndroidHardwareBufferANDROID must return that same Android hardware buffer object.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

VkMemoryGetAndroidHardwareBufferInfoANDROID

Parameters
device:VkDevice

the logical device that created the device memory being exported.

pInfo:VkMemoryGetAndroidHardwareBufferInfoANDROID

a pointer to a VkMemoryGetAndroidHardwareBufferInfoANDROID structure containing parameters of the export operation.

pBuffer:PointerBuffer

will return an Android hardware buffer referencing the payload of the device memory object.

Annotations
@NativeType:VkResult