!1 add ohos surface vulkan externsion

Merge pull request !1 from stonesxd/ohos_vulkan
This commit is contained in:
openharmony_sig_ci 2022-05-06 09:09:28 +00:00 committed by Gitee
commit 841a390010
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 65 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# Copyright (C) 2018-2019 The ANGLE Project Authors.
# Copyright (C) 2019 LunarG, Inc.
# Copyright (c) 2022 Huawei Device Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -13,11 +14,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build_overrides/vulkan_headers.gni")
import("//build/ohos.gni")
is_ohos = current_os == "ohos"
is_android = current_os == "android"
is_mac = current_os == "ios" || current_os == "tvos" || current_os == "mac"
is_win = current_os == "win" || current_os == "mingw"
is_linux = current_os == "linux"
is_fuchsia = current_os == "fuchsia"
config("vulkan_headers_config") {
include_dirs = [ "include" ]
if (is_ohos) {
defines = [ "VK_USE_PLATFORM_OHOS" ]
}
if (is_win) {
defines = [ "VK_USE_PLATFORM_WIN32_KHR" ]
}
@ -48,8 +59,7 @@ source_set("vulkan_headers") {
"include/vulkan/vulkan.h",
"include/vulkan/vulkan.hpp",
"include/vulkan/vulkan_core.h",
"include/vulkan/vulkan_screen.h",
"include/vulkan/vulkan_ohos.h",
]
public_configs = [ ":vulkan_headers_config" ]
}

View File

@ -85,6 +85,11 @@
#include "vulkan_screen.h"
#endif
#ifdef VK_USE_PLATFORM_OHOS
#include <native_window/window.h>
#include "vulkan_ohos.h"
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
#include "vulkan_beta.h"
#endif

View File

@ -0,0 +1,47 @@
#ifndef VULKAN_OHOS_H_
#define VULKAN_OHOS_H_ 1
/*
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
#define VK_OHOS_openhm_surface 1
#define VK_OHOS_OPENHM_SURFACE_SPEC_VERSION 1
#define VK_OHOS_OPENHM_SURFACE_EXTENSION_NAME "VK_OHOS_openhm_surface"
typedef VkFlags VkOpenhmSurfaceCreateFlagsOHOS;
typedef struct VkOpenhmSurfaceCreateInfoOHOS {
VkStructureType sType;
const void* pNext;
VkOpenhmSurfaceCreateFlagsOHOS flags;
OHNativeWindow* window;
} VkOpenhmSurfaceCreateInfoOHOS;
typedef VkResult (VKAPI_PTR *PFN_VkCreateOpenhmSurfaceOHOS)(VkInstance instance, const VkOpenhmSurfaceCreateInfoOHOS* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL VkCreateOpenhmSurfaceOHOS(
VkInstance instance,
const VkOpenhmSurfaceCreateInfoOHOS* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif