1 #ifndef VULKAN_ANDROID_H_ 2 #define VULKAN_ANDROID_H_ 1 3 4 /* 5 ** Copyright 2015-2022 The Khronos Group Inc. 6 ** 7 ** SPDX-License-Identifier: Apache-2.0 8 */ 9 10 /* 11 ** This header is generated from the Khronos Vulkan XML API Registry. 12 ** 13 */ 14 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 21 22 #define VK_KHR_android_surface 1 23 struct ANativeWindow; 24 #define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 25 #define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" 26 typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; 27 typedef struct VkAndroidSurfaceCreateInfoKHR { 28 VkStructureType sType; 29 const void* pNext; 30 VkAndroidSurfaceCreateFlagsKHR flags; 31 struct ANativeWindow* window; 32 } VkAndroidSurfaceCreateInfoKHR; 33 34 typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 35 36 #ifndef VK_NO_PROTOTYPES 37 VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( 38 VkInstance instance, 39 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, 40 const VkAllocationCallbacks* pAllocator, 41 VkSurfaceKHR* pSurface); 42 #endif 43 44 45 #define VK_ANDROID_external_memory_android_hardware_buffer 1 46 struct AHardwareBuffer; 47 #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5 48 #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer" 49 typedef struct VkAndroidHardwareBufferUsageANDROID { 50 VkStructureType sType; 51 void* pNext; 52 uint64_t androidHardwareBufferUsage; 53 } VkAndroidHardwareBufferUsageANDROID; 54 55 typedef struct VkAndroidHardwareBufferPropertiesANDROID { 56 VkStructureType sType; 57 void* pNext; 58 VkDeviceSize allocationSize; 59 uint32_t memoryTypeBits; 60 } VkAndroidHardwareBufferPropertiesANDROID; 61 62 typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID { 63 VkStructureType sType; 64 void* pNext; 65 VkFormat format; 66 uint64_t externalFormat; 67 VkFormatFeatureFlags formatFeatures; 68 VkComponentMapping samplerYcbcrConversionComponents; 69 VkSamplerYcbcrModelConversion suggestedYcbcrModel; 70 VkSamplerYcbcrRange suggestedYcbcrRange; 71 VkChromaLocation suggestedXChromaOffset; 72 VkChromaLocation suggestedYChromaOffset; 73 } VkAndroidHardwareBufferFormatPropertiesANDROID; 74 75 typedef struct VkImportAndroidHardwareBufferInfoANDROID { 76 VkStructureType sType; 77 const void* pNext; 78 struct AHardwareBuffer* buffer; 79 } VkImportAndroidHardwareBufferInfoANDROID; 80 81 typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID { 82 VkStructureType sType; 83 const void* pNext; 84 VkDeviceMemory memory; 85 } VkMemoryGetAndroidHardwareBufferInfoANDROID; 86 87 typedef struct VkExternalFormatANDROID { 88 VkStructureType sType; 89 void* pNext; 90 uint64_t externalFormat; 91 } VkExternalFormatANDROID; 92 93 typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID { 94 VkStructureType sType; 95 void* pNext; 96 VkFormat format; 97 uint64_t externalFormat; 98 VkFormatFeatureFlags2 formatFeatures; 99 VkComponentMapping samplerYcbcrConversionComponents; 100 VkSamplerYcbcrModelConversion suggestedYcbcrModel; 101 VkSamplerYcbcrRange suggestedYcbcrRange; 102 VkChromaLocation suggestedXChromaOffset; 103 VkChromaLocation suggestedYChromaOffset; 104 } VkAndroidHardwareBufferFormatProperties2ANDROID; 105 106 typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties); 107 typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer); 108 109 #ifndef VK_NO_PROTOTYPES 110 VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID( 111 VkDevice device, 112 const struct AHardwareBuffer* buffer, 113 VkAndroidHardwareBufferPropertiesANDROID* pProperties); 114 115 VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID( 116 VkDevice device, 117 const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, 118 struct AHardwareBuffer** pBuffer); 119 #endif 120 121 #ifdef __cplusplus 122 } 123 #endif 124 125 #endif 126