1 #ifndef VULKAN_ANDROID_H_ 2 #define VULKAN_ANDROID_H_ 1 3 4 /* 5 ** Copyright (c) 2015-2019 The Khronos Group Inc. 6 ** 7 ** Licensed under the Apache License, Version 2.0 (the "License"); 8 ** you may not use this file except in compliance with the License. 9 ** You may obtain a copy of the License at 10 ** 11 ** http://www.apache.org/licenses/LICENSE-2.0 12 ** 13 ** Unless required by applicable law or agreed to in writing, software 14 ** distributed under the License is distributed on an "AS IS" BASIS, 15 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 ** See the License for the specific language governing permissions and 17 ** limitations under the License. 18 */ 19 20 /* 21 ** This header is generated from the Khronos Vulkan XML API Registry. 22 ** 23 */ 24 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 31 32 #define VK_KHR_android_surface 1 33 struct ANativeWindow; 34 #define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 35 #define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface" 36 typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; 37 typedef struct VkAndroidSurfaceCreateInfoKHR { 38 VkStructureType sType; 39 const void* pNext; 40 VkAndroidSurfaceCreateFlagsKHR flags; 41 struct ANativeWindow* window; 42 } VkAndroidSurfaceCreateInfoKHR; 43 44 typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 46 #ifndef VK_NO_PROTOTYPES 47 VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( 48 VkInstance instance, 49 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, 50 const VkAllocationCallbacks* pAllocator, 51 VkSurfaceKHR* pSurface); 52 #endif 53 54 55 #define VK_ANDROID_external_memory_android_hardware_buffer 1 56 struct AHardwareBuffer; 57 #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3 58 #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer" 59 typedef struct VkAndroidHardwareBufferUsageANDROID { 60 VkStructureType sType; 61 void* pNext; 62 uint64_t androidHardwareBufferUsage; 63 } VkAndroidHardwareBufferUsageANDROID; 64 65 typedef struct VkAndroidHardwareBufferPropertiesANDROID { 66 VkStructureType sType; 67 void* pNext; 68 VkDeviceSize allocationSize; 69 uint32_t memoryTypeBits; 70 } VkAndroidHardwareBufferPropertiesANDROID; 71 72 typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID { 73 VkStructureType sType; 74 void* pNext; 75 VkFormat format; 76 uint64_t externalFormat; 77 VkFormatFeatureFlags formatFeatures; 78 VkComponentMapping samplerYcbcrConversionComponents; 79 VkSamplerYcbcrModelConversion suggestedYcbcrModel; 80 VkSamplerYcbcrRange suggestedYcbcrRange; 81 VkChromaLocation suggestedXChromaOffset; 82 VkChromaLocation suggestedYChromaOffset; 83 } VkAndroidHardwareBufferFormatPropertiesANDROID; 84 85 typedef struct VkImportAndroidHardwareBufferInfoANDROID { 86 VkStructureType sType; 87 const void* pNext; 88 struct AHardwareBuffer* buffer; 89 } VkImportAndroidHardwareBufferInfoANDROID; 90 91 typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID { 92 VkStructureType sType; 93 const void* pNext; 94 VkDeviceMemory memory; 95 } VkMemoryGetAndroidHardwareBufferInfoANDROID; 96 97 typedef struct VkExternalFormatANDROID { 98 VkStructureType sType; 99 void* pNext; 100 uint64_t externalFormat; 101 } VkExternalFormatANDROID; 102 103 typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties); 104 typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer); 105 106 #ifndef VK_NO_PROTOTYPES 107 VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID( 108 VkDevice device, 109 const struct AHardwareBuffer* buffer, 110 VkAndroidHardwareBufferPropertiesANDROID* pProperties); 111 112 VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID( 113 VkDevice device, 114 const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, 115 struct AHardwareBuffer** pBuffer); 116 #endif 117 118 #ifdef __cplusplus 119 } 120 #endif 121 122 #endif 123