1 #ifndef VULKAN_OHOS_H_ 2 #define VULKAN_OHOS_H_ 1 3 4 /* 5 ** Copyright 2015-2021 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 #define VK_OpenHarmony_OHOS_surface 1 21 struct NativeWindow; 22 #define VK_OPENHARMONY_OHOS_SURFACE_SPEC_VERSION 1 23 #define VK_OPENHARMONY_OHOS_SURFACE_EXTENSION_NAME "VK_OpenHarmony_OHOS_surface" 24 // VK_STRUCTURE_TYPE_OHOS_SURFACE_CREATE_INFO_OPENHARMONY 25 typedef VkFlags VkOHOSSurfaceCreateFlagsOpenHarmony; 26 typedef struct VkOHOSSurfaceCreateInfoOpenHarmony { 27 VkStructureType sType; 28 const void* pNext; 29 VkOHOSSurfaceCreateFlagsOpenHarmony flags; 30 NativeWindow* window; 31 } VkOHOSSurfaceCreateInfoOpenHarmony; 32 33 typedef VkResult (VKAPI_PTR *PFN_vkCreateOHOSSurfaceOpenHarmony)(VkInstance instance, const VkOHOSSurfaceCreateInfoOpenHarmony* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 34 35 #ifndef VK_NO_PROTOTYPES 36 VKAPI_ATTR VkResult VKAPI_CALL vkCreateOHOSSurfaceOpenHarmony( 37 VkInstance instance, 38 const VkOHOSSurfaceCreateInfoOpenHarmony* pCreateInfo, 39 const VkAllocationCallbacks* pAllocator, 40 VkSurfaceKHR* pSurface); 41 #endif 42 43 #define VK_OpenHarmony_external_memory_OHOS_native_buffer 1 44 struct OH_NativeBuffer; 45 #define VK_OPENHARMONY_EXTERNAL_MEMORY_OHOS_NATIVE_BUFFER_SPEC_VERSION 1 46 #define VK_OPENHARMONY_EXTERNAL_MEMORY_OHOS_NATIVE_BUFFER_EXTENSION_NAME "VK_OpenHarmony_external_memory_OHOS_native_buffer" 47 typedef struct VkOHOSNativeBufferUsageOpenHarmony { 48 VkStructureType sType; 49 void* pNext; 50 uint64_t OHOSNativeBufferUsage; 51 } VkOHOSNativeBufferUsageOpenHarmony; 52 53 typedef struct VkOHOSNativeBufferPropertiesOpenHarmony { 54 VkStructureType sType; 55 void* pNext; 56 VkDeviceSize allocationSize; 57 uint32_t memoryTypeBits; 58 } VkOHOSNativeBufferPropertiesOpenHarmony; 59 60 typedef struct VkOHOSNativeBufferFormatPropertiesOpenHarmony { 61 VkStructureType sType; 62 void* pNext; 63 VkFormat format; 64 uint64_t externalFormat; 65 VkFormatFeatureFlags formatFeatures; 66 VkComponentMapping samplerYcbcrConversionComponents; 67 VkSamplerYcbcrModelConversion suggestedYcbcrModel; 68 VkSamplerYcbcrRange suggestedYcbcrRange; 69 VkChromaLocation suggestedXChromaOffset; 70 VkChromaLocation suggestedYChromaOffset; 71 } VkOHOSNativeBufferFormatPropertiesOpenHarmony; 72 73 typedef struct VkImportOHOSNativeBufferInfoOpenHarmony { 74 VkStructureType sType; 75 const void* pNext; 76 struct OH_NativeBuffer* buffer; 77 } VkImportOHOSNativeBufferInfoOpenHarmony; 78 79 typedef struct VkMemoryGetOHOSNativeBufferInfoOpenHarmony { 80 VkStructureType sType; 81 const void* pNext; 82 VkDeviceMemory memory; 83 } VkMemoryGetOHOSNativeBufferInfoOpenHarmony; 84 85 typedef struct VkExternalFormatOpenHarmony { 86 VkStructureType sType; 87 void* pNext; 88 uint64_t externalFormat; 89 } VkExternalFormatOpenHarmony; 90 91 typedef VkResult (VKAPI_PTR *PFN_vkGetOHOSNativeBufferPropertiesOpenHarmony)(VkDevice device, const struct OH_NativeBuffer* buffer, VkOHOSNativeBufferPropertiesOpenHarmony* pProperties); 92 typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryOHOSNativeBufferOpenHarmony)(VkDevice device, const VkMemoryGetOHOSNativeBufferInfoOpenHarmony* pInfo, struct OH_NativeBuffer** pBuffer); 93 94 #ifndef VK_NO_PROTOTYPES 95 VKAPI_ATTR VkResult VKAPI_CALL vkGetOHOSNativeBufferPropertiesOpenHarmony( 96 VkDevice device, 97 const struct OH_NativeBuffer* buffer, 98 VkOHOSNativeBufferPropertiesOpenHarmony* pProperties); 99 100 VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryOHOSNativeBufferOpenHarmony( 101 VkDevice device, 102 const VkMemoryGetOHOSNativeBufferInfoOpenHarmony* pInfo, 103 struct OH_NativeBuffer** pBuffer); 104 #endif 105 106 107 #ifdef __cplusplus 108 } 109 #endif 110 111 #endif 112