vulkan-2.1.0.0: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer

Synopsis

Documentation

data AHardwareBuffer Source #

Opaque data

vkGetAndroidHardwareBufferPropertiesANDROID :: ("device" ::: VkDevice) -> ("buffer" ::: Ptr AHardwareBuffer) -> ("pProperties" ::: Ptr VkAndroidHardwareBufferPropertiesANDROID) -> IO VkResult Source #

vkGetAndroidHardwareBufferPropertiesANDROID - Get Properties of External Memory Android Hardware Buffers

Parameters

  • device is the logical device that will be importing buffer.
  • buffer is the Android hardware buffer which will be imported.
  • pProperties will return properties of buffer.

Valid Usage

  • buffer must be a valid Android hardware buffer object with at least one of the AHARDWAREBUFFER_USAGE_GPU_* usage flags.

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • buffer must be a valid pointer to a valid AHardwareBuffer value
  • pProperties must be a valid pointer to a VkAndroidHardwareBufferPropertiesANDROID structure

Return Codes

[Success] - VK_SUCCESS

[Failure] - VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR

See Also

VkAndroidHardwareBufferPropertiesANDROID, VkDevice

vkGetMemoryAndroidHardwareBufferANDROID :: ("device" ::: VkDevice) -> ("pInfo" ::: Ptr VkMemoryGetAndroidHardwareBufferInfoANDROID) -> ("pBuffer" ::: Ptr (Ptr AHardwareBuffer)) -> IO VkResult Source #

vkGetMemoryAndroidHardwareBufferANDROID - Get an Android hardware buffer for a memory object

Parameters

  • device is the logical device that created the device memory being exported.
  • pInfo is a pointer to an instance of the VkMemoryGetAndroidHardwareBufferInfoANDROID structure containing parameters of the export operation.
  • pBuffer will return an Android hardware buffer representing the underlying resources of the device memory object.

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)

  • device must be a valid VkDevice handle
  • pInfo must be a valid pointer to a valid VkMemoryGetAndroidHardwareBufferInfoANDROID structure
  • pBuffer must be a valid pointer to a valid pointer to a AHardwareBuffer value

Return Codes

[Success] - VK_SUCCESS

[Failure] - VK_ERROR_TOO_MANY_OBJECTS

  • VK_ERROR_OUT_OF_HOST_MEMORY

See Also

VkDevice, VkMemoryGetAndroidHardwareBufferInfoANDROID

data VkImportAndroidHardwareBufferInfoANDROID Source #

VkImportAndroidHardwareBufferInfoANDROID - Import memory from an Android hardware buffer

Description

If the vkAllocateMemory command succeeds, the implementation must acquire a reference to the imported hardware buffer, which it must release when the device memory object is freed. If the command fails, the implementation must not retain a reference.

Valid Usage

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID
  • buffer must be a valid pointer to a AHardwareBuffer value

See Also

VkStructureType

Constructors

VkImportAndroidHardwareBufferInfoANDROID 

Fields

data VkAndroidHardwareBufferUsageANDROID Source #

VkAndroidHardwareBufferUsageANDROID - Struct containing Android hardware buffer usage flags

Description

The androidHardwareBufferUsage field must include Android hardware buffer usage flags listed in the AHardwareBuffer Usage Equivalence table when the corresponding Vulkan image usage or image creation flags are included in the usage or flags fields of VkPhysicalDeviceImageFormatInfo2. It must include at least one GPU usage flag (AHARDWAREBUFFER_USAGE_GPU_*), even if none of the corresponding Vulkan usages or flags are requested.

Note

Requiring at least one GPU usage flag ensures that Android hardware buffer memory will be allocated in a memory pool accessible to the Vulkan implementation, and that specializing the memory layout based on usage flags doesn’t prevent it from being compatible with Vulkan. Implementations may avoid unnecessary restrictions caused by this requirement by using vendor usage flags to indicate that only the Vulkan uses indicated in VkImageFormatProperties2 are required.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID

See Also

VkStructureType

Constructors

VkAndroidHardwareBufferUsageANDROID 

Fields

data VkAndroidHardwareBufferPropertiesANDROID Source #

VkAndroidHardwareBufferPropertiesANDROID - Properties of External Memory Android Hardware Buffers

See Also

VkDeviceSize, VkStructureType, vkGetAndroidHardwareBufferPropertiesANDROID

Constructors

VkAndroidHardwareBufferPropertiesANDROID 

Fields

data VkMemoryGetAndroidHardwareBufferInfoANDROID Source #

VkMemoryGetAndroidHardwareBufferInfoANDROID - Structure describing an Android hardware buffer memory export operation

Valid Usage

  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID must have been included in VkExportMemoryAllocateInfoKHR::handleTypes when memory was created.
  • If the pNext chain of the VkMemoryAllocateInfo used to allocate memory included a VkMemoryDedicatedAllocateInfo with non-NULL image member, then that image must already be bound to memory.

See Also

VkDeviceMemory, VkStructureType, vkGetMemoryAndroidHardwareBufferANDROID

Constructors

VkMemoryGetAndroidHardwareBufferInfoANDROID 

Fields

data VkAndroidHardwareBufferFormatPropertiesANDROID Source #

VkAndroidHardwareBufferFormatPropertiesANDROID - Structure describing the image format properties of an Android hardware buffer

Description

If the Android hardware buffer has one of the formats listed in the Format Equivalence table, then format must have the equivalent Vulkan format listed in the table. Otherwise, format may be VK_FORMAT_UNDEFINED, indicating the Android hardware buffer can only be used with an external format.

The formatFeatures member must include VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT and at least one of VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT or VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, and should include VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT and VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT.

Android hardware buffers with the same external format must have the same support for VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, and VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT. Other format features may differ between Android hardware buffers that have the same external format. This allows applications to use the same VkSamplerYcbcrConversion object (and samplers and pipelines created from them) for any Android hardware buffers that have the same external format.

If format is not VK_FORMAT_UNDEFINED, then the value of samplerYcbcrConversionComponents must be valid when used as the components member of VkSamplerYcbcrConversionCreateInfo with that format. If format is VK_FORMAT_UNDEFINED, all members of samplerYcbcrConversionComponents must be VK_COMPONENT_SWIZZLE_IDENTITY.

Implementations may not always be able to determine the color model, numerical range, or chroma offsets of the image contents, so the values in VkAndroidHardwareBufferFormatPropertiesANDROID are only suggestions. Applications should treat these values as sensible defaults to use in the absence of more reliable information obtained through some other means. If the underlying physical device is also usable via OpenGL ES with the GL_OES_EGL_image_external extension, the implementation should suggest values that will produce similar sampled values as would be obtained by sampling the same external image via samplerExternalOES in OpenGL ES using equivalent sampler parameters.

Note

Since GL_OES_EGL_image_external does not require the same sampling and conversion calculations as Vulkan does, achieving identical results between APIs may not be possible on some implementations.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID

See Also

VkChromaLocation, VkComponentMapping, VkFormat, VkFormatFeatureFlags, VkSamplerYcbcrModelConversion, VkSamplerYcbcrRange, VkStructureType

Constructors

VkAndroidHardwareBufferFormatPropertiesANDROID 

Fields

Instances
Eq VkAndroidHardwareBufferFormatPropertiesANDROID Source # 
Instance details
Show VkAndroidHardwareBufferFormatPropertiesANDROID Source # 
Instance details
Storable VkAndroidHardwareBufferFormatPropertiesANDROID Source # 
Instance details

data VkExternalFormatANDROID Source #

VkExternalFormatANDROID - Structure containing an Android hardware buffer external format

Description

If externalFormat is zero, the effect is as if the VkExternalFormatANDROID structure was not present. Otherwise, the image will have the specified external format, and VkImageCreateInfo::format must be VK_FORMAT_UNDEFINED.

Valid Usage

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID

See Also

VkStructureType

Constructors

VkExternalFormatANDROID 

Fields