diff --git a/scripts/genvk.py b/scripts/genvk.py
index 39051a0ca23fda31b06b16ea5c888ac6198c3830..00dcbf0c508117005701317de414ca96439dc200 100755
--- a/scripts/genvk.py
+++ b/scripts/genvk.py
@@ -479,6 +479,10 @@ def makeGenOpts(args):
'VK_NV_external_sci_sync2',
'VK_NV_external_memory_sci_buf'], commonSuppressExtensions ],
[ 'vulkan_beta.h', betaRequireExtensions, betaSuppressExtensions ],
+ [ 'vulkan_ohos.h', [ 'VK_OHOS_surface',
+ 'VK_OHOS_native_buffer',
+ 'VK_OHOS_external_memory'
+ ], commonSuppressExtensions ],
]
for platform in platforms:
diff --git a/xml/Makefile b/xml/Makefile
index 7fcec5069bc566cced8be9d032958bb42aac6a11..2173ccec9cae06bad9d1c6dc3f3589f7d73a548f 100644
--- a/xml/Makefile
+++ b/xml/Makefile
@@ -77,6 +77,7 @@ PLATFORM_HEADERS = \
$(VULKAN)/vulkan_xlib_xrandr.h \
$(VULKAN)/vulkan_metal.h \
$(VULKAN)/vulkan_screen.h \
+ $(VULKAN)/vulkan_ohos.h \
$(VULKAN)/vulkan_beta.h
#@ vulkan_sci.h is Vulkan SC-specific
diff --git a/xml/vk.xml b/xml/vk.xml
index ea6d66476e7e7cbdf3158259192a5e16760c626b..a9797b20e18b0b2e3f414d68bfdd7746cda89a58 100755
--- a/xml/vk.xml
+++ b/xml/vk.xml
@@ -35,6 +35,7 @@ branch of the member gitlab server.
+
@@ -76,6 +77,7 @@ branch of the member gitlab server.
+
@@ -92,6 +94,7 @@ branch of the member gitlab server.
+
@@ -132,6 +135,7 @@ branch of the member gitlab server.
+
@@ -234,6 +238,9 @@ branch of the member gitlab server.
struct ANativeWindow;
struct AHardwareBuffer;
+ typedef struct NativeWindow OHNativeWindow;
+ struct OHBufferHandle;
+ struct OH_NativeBuffer;
#ifdef __OBJC__
@class CAMetalLayer;
#else
@@ -426,6 +433,7 @@ typedef void* MTLSharedEvent_id;
typedef VkFlags VkStreamDescriptorSurfaceCreateFlagsGGP;
typedef VkFlags VkHeadlessSurfaceCreateFlagsEXT;
typedef VkFlags VkScreenSurfaceCreateFlagsQNX;
+ typedef VkFlags VkSurfaceCreateFlagsOHOS;
typedef VkFlags VkPeerMemoryFeatureFlags;
typedef VkFlags VkMemoryAllocateFlags;
@@ -475,6 +483,7 @@ typedef void* MTLSharedEvent_id;
typedef VkFlags VkPipelineRasterizationStateStreamCreateFlagsEXT;
typedef VkFlags VkPipelineRasterizationDepthClipStateCreateFlagsEXT;
typedef VkFlags VkSwapchainImageUsageFlagsANDROID;
+ typedef VkFlags VkSwapchainImageUsageFlagsOHOS;
typedef VkFlags VkToolPurposeFlags;
typedef VkFlags VkSubmitFlags;
@@ -928,6 +937,7 @@ typedef void* MTLSharedEvent_id;
+
@@ -2309,6 +2319,12 @@ typedef void* MTLSharedEvent_id;
struct _screen_context* context
struct _screen_window* window
+
+ VkStructureType sType
+ const void* pNext
+ VkSurfaceCreateFlagsOHOS flags
+ OHNativeWindow* window
+
VkFormat formatSupported pair of rendering format
VkColorSpaceKHR colorSpaceand color space for the surface
@@ -4152,6 +4168,21 @@ typedef void* MTLSharedEvent_id;
const void* pNext
VkBool32 sharedImage
+
+ VkStructureType sType
+ const void* pNext
+ struct OHBufferHandle* handle
+
+
+ VkStructureType sType
+ const void* pNext
+ VkSwapchainImageUsageFlagsOHOS usage
+
+
+ VkStructureType sType
+ const void* pNext
+ VkBool32 sharedImage
+
uint32_t numUsedVgprs
uint32_t numUsedSgprs
@@ -4594,6 +4625,44 @@ typedef void* MTLSharedEvent_id;
void* pNext
uint64_t externalFormat
+
+ VkStructureType sType
+ const void* pNext
+ struct OH_NativeBuffer* buffer
+
+
+ VkStructureType sType
+ void* pNext
+ uint64_t OHOSNativeBufferUsage
+
+
+ VkStructureType sType
+ void* pNext
+ VkDeviceSize allocationSize
+ uint32_t memoryTypeBits
+
+
+ VkStructureType sType
+ const void* pNext
+ VkDeviceMemory memory
+
+
+ VkStructureType sType
+ void* pNext
+ VkFormat format
+ uint64_t externalFormat
+ VkFormatFeatureFlags formatFeatures
+ VkComponentMapping samplerYcbcrConversionComponents
+ VkSamplerYcbcrModelConversion suggestedYcbcrModel
+ VkSamplerYcbcrRange suggestedYcbcrRange
+ VkChromaLocation suggestedXChromaOffset
+ VkChromaLocation suggestedYChromaOffset
+
+
+ VkStructureType sType
+ void* pNext
+ uint64_t externalFormat
+
VkStructureType sType
void* pNext
@@ -11072,6 +11141,9 @@ typedef void* MTLSharedEvent_id;
+
+
+
@@ -14569,6 +14641,48 @@ typedef void* MTLSharedEvent_id;
VkImage image
int* pNativeFenceFd
+
+ VkResult vkCreateSurfaceOHOS
+ VkInstance instance
+ const VkSurfaceCreateInfoOHOS* pCreateInfo
+ const VkAllocationCallbacks* pAllocator
+ VkSurfaceKHR* pSurface
+
+
+ VkResult vkGetNativeBufferPropertiesOHOS
+ VkDevice device
+ const struct OH_NativeBuffer* buffer
+ VkNativeBufferPropertiesOHOS* pProperties
+
+
+ VkResult vkGetMemoryNativeBufferOHOS
+ VkDevice device
+ const VkMemoryGetNativeBufferInfoOHOS* pInfo
+ struct OH_NativeBuffer** pBuffer
+
+
+ VkResult vkGetSwapchainGrallocUsageOHOS
+ VkDevice device
+ VkFormat format
+ VkImageUsageFlags imageUsage
+ uint64_t* grallocUsage
+
+
+ VkResult vkAcquireImageOHOS
+ VkDevice device
+ VkImage image
+ int32_t nativeFenceFd
+ VkSemaphore semaphore
+ VkFence fence
+
+
+ VkResult vkQueueSignalReleaseImageOHOS
+ VkQueue queue
+ uint32_t waitSemaphoreCount
+ const VkSemaphore* pWaitSemaphores
+ VkImage image
+ int32_t* pNativeFenceFd
+
VkResult vkGetShaderInfoAMD
VkDevice device
@@ -24094,7 +24208,7 @@ typedef void* MTLSharedEvent_id;
-
+
@@ -26898,23 +27012,55 @@ typedef void* MTLSharedEvent_id;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ VK_OHOS_native_buffer is used between the OpenHarmony OS Vulkan loader and drivers to implement the WSI extensions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+