1 #ifndef VULKAN_ANDROID_H_ 2 #define VULKAN_ANDROID_H_ 1 3 4 /* 5 ** Copyright 2015-2023 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 // VK_KHR_android_surface is a preprocessor guard. Do not pass it to API calls. 23 #define VK_KHR_android_surface 1 24 struct ANativeWindow; 25 #define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 26 #define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" 27 typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; 28 typedef struct VkAndroidSurfaceCreateInfoKHR { 29 VkStructureType sType; 30 const void* pNext; 31 VkAndroidSurfaceCreateFlagsKHR flags; 32 struct ANativeWindow* window; 33 } VkAndroidSurfaceCreateInfoKHR; 34 35 typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 36 37 #ifndef VK_NO_PROTOTYPES 38 VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( 39 VkInstance instance, 40 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, 41 const VkAllocationCallbacks* pAllocator, 42 VkSurfaceKHR* pSurface); 43 #endif 44 45 46 // VK_ANDROID_external_memory_android_hardware_buffer is a preprocessor guard. Do not pass it to API calls. 47 #define VK_ANDROID_external_memory_android_hardware_buffer 1 48 struct AHardwareBuffer; 49 #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5 50 #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer" 51 typedef struct VkAndroidHardwareBufferUsageANDROID { 52 VkStructureType sType; 53 void* pNext; 54 uint64_t androidHardwareBufferUsage; 55 } VkAndroidHardwareBufferUsageANDROID; 56 57 typedef struct VkAndroidHardwareBufferPropertiesANDROID { 58 VkStructureType sType; 59 void* pNext; 60 VkDeviceSize allocationSize; 61 uint32_t memoryTypeBits; 62 } VkAndroidHardwareBufferPropertiesANDROID; 63 64 typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID { 65 VkStructureType sType; 66 void* pNext; 67 VkFormat format; 68 uint64_t externalFormat; 69 VkFormatFeatureFlags formatFeatures; 70 VkComponentMapping samplerYcbcrConversionComponents; 71 VkSamplerYcbcrModelConversion suggestedYcbcrModel; 72 VkSamplerYcbcrRange suggestedYcbcrRange; 73 VkChromaLocation suggestedXChromaOffset; 74 VkChromaLocation suggestedYChromaOffset; 75 } VkAndroidHardwareBufferFormatPropertiesANDROID; 76 77 typedef struct VkImportAndroidHardwareBufferInfoANDROID { 78 VkStructureType sType; 79 const void* pNext; 80 struct AHardwareBuffer* buffer; 81 } VkImportAndroidHardwareBufferInfoANDROID; 82 83 typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID { 84 VkStructureType sType; 85 const void* pNext; 86 VkDeviceMemory memory; 87 } VkMemoryGetAndroidHardwareBufferInfoANDROID; 88 89 typedef struct VkExternalFormatANDROID { 90 VkStructureType sType; 91 void* pNext; 92 uint64_t externalFormat; 93 } VkExternalFormatANDROID; 94 95 typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID { 96 VkStructureType sType; 97 void* pNext; 98 VkFormat format; 99 uint64_t externalFormat; 100 VkFormatFeatureFlags2 formatFeatures; 101 VkComponentMapping samplerYcbcrConversionComponents; 102 VkSamplerYcbcrModelConversion suggestedYcbcrModel; 103 VkSamplerYcbcrRange suggestedYcbcrRange; 104 VkChromaLocation suggestedXChromaOffset; 105 VkChromaLocation suggestedYChromaOffset; 106 } VkAndroidHardwareBufferFormatProperties2ANDROID; 107 108 typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties); 109 typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer); 110 111 #ifndef VK_NO_PROTOTYPES 112 VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID( 113 VkDevice device, 114 const struct AHardwareBuffer* buffer, 115 VkAndroidHardwareBufferPropertiesANDROID* pProperties); 116 117 VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID( 118 VkDevice device, 119 const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, 120 struct AHardwareBuffer** pBuffer); 121 #endif 122 123 124 // VK_ANDROID_external_format_resolve is a preprocessor guard. Do not pass it to API calls. 125 #define VK_ANDROID_external_format_resolve 1 126 #define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_SPEC_VERSION 1 127 #define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_EXTENSION_NAME "VK_ANDROID_external_format_resolve" 128 typedef struct VkPhysicalDeviceExternalFormatResolveFeaturesANDROID { 129 VkStructureType sType; 130 void* pNext; 131 VkBool32 externalFormatResolve; 132 } VkPhysicalDeviceExternalFormatResolveFeaturesANDROID; 133 134 typedef struct VkPhysicalDeviceExternalFormatResolvePropertiesANDROID { 135 VkStructureType sType; 136 void* pNext; 137 VkBool32 nullColorAttachmentWithExternalFormatResolve; 138 VkChromaLocation externalFormatResolveChromaOffsetX; 139 VkChromaLocation externalFormatResolveChromaOffsetY; 140 } VkPhysicalDeviceExternalFormatResolvePropertiesANDROID; 141 142 typedef struct VkAndroidHardwareBufferFormatResolvePropertiesANDROID { 143 VkStructureType sType; 144 void* pNext; 145 VkFormat colorAttachmentFormat; 146 } VkAndroidHardwareBufferFormatResolvePropertiesANDROID; 147 148 149 #ifdef __cplusplus 150 } 151 #endif 152 153 #endif 154