Try to use the vulkan-headers from vulkan-deps instead of third_party/khronos.

Change-Id: Ic4af5ec86e4ea2ec404a6e32e49068fc5993d55a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This commit is contained in:
Loko Kung 2022-04-01 05:22:55 +00:00 committed by Dawn LUCI CQ
parent 9994722d36
commit 09100b79d0
3 changed files with 34 additions and 6 deletions

View File

@ -54,6 +54,14 @@ if (!defined(dawn_swiftshader_dir)) {
dawn_swiftshader_dir = "" dawn_swiftshader_dir = ""
} }
if (!defined(dawn_vulkan_headers_dir)) {
dawn_vulkan_headers_dir = "//third_party/vulkan-deps/vulkan-headers/src"
if (dawn_standalone) {
dawn_vulkan_headers_dir =
"${dawn_root}/third_party/vulkan-deps/vulkan-headers/src"
}
}
if (!defined(dawn_vulkan_loader_dir)) { if (!defined(dawn_vulkan_loader_dir)) {
# Default to the Vulkan loader not being available except in standalone. # Default to the Vulkan loader not being available except in standalone.
dawn_vulkan_loader_dir = "" dawn_vulkan_loader_dir = ""

View File

@ -155,26 +155,46 @@ namespace dawn::native::vulkan {
// Import additional parts of Vulkan that are supported on our architecture and preemptively include // Import additional parts of Vulkan that are supported on our architecture and preemptively include
// headers that vulkan.h includes that we have "undefs" for. // headers that vulkan.h includes that we have "undefs" for.
#if defined(DAWN_PLATFORM_WINDOWS) #if defined(DAWN_PLATFORM_WINDOWS)
# define VK_USE_PLATFORM_WIN32_KHR # ifndef VK_USE_PLATFORM_WIN32_KHR
# define VK_USE_PLATFORM_WIN32_KHR
# endif
# include "dawn/common/windows_with_undefs.h" # include "dawn/common/windows_with_undefs.h"
#else
# undef VK_USE_PLATFORM_WIN32_KHR
#endif // DAWN_PLATFORM_WINDOWS #endif // DAWN_PLATFORM_WINDOWS
#if defined(DAWN_USE_X11) #if defined(DAWN_USE_X11)
# define VK_USE_PLATFORM_XLIB_KHR # define VK_USE_PLATFORM_XLIB_KHR
# define VK_USE_PLATFORM_XCB_KHR # ifndef VK_USE_PLATFORM_XCB_KHR
# define VK_USE_PLATFORM_XCB_KHR
# endif
# include "dawn/common/xlib_with_undefs.h" # include "dawn/common/xlib_with_undefs.h"
#else
# undef VK_USE_PLATFORM_XCB_KHR
#endif // defined(DAWN_USE_X11) #endif // defined(DAWN_USE_X11)
#if defined(DAWN_ENABLE_BACKEND_METAL) #if defined(DAWN_ENABLE_BACKEND_METAL)
# define VK_USE_PLATFORM_METAL_EXT # ifndef VK_USE_PLATFORM_METAL_EXT
# define VK_USE_PLATFORM_METAL_EXT
# endif
#else
# undef VK_USE_PLATFORM_METAL_EXT
#endif // defined(DAWN_ENABLE_BACKEND_METAL) #endif // defined(DAWN_ENABLE_BACKEND_METAL)
#if defined(DAWN_PLATFORM_ANDROID) #if defined(DAWN_PLATFORM_ANDROID)
# define VK_USE_PLATFORM_ANDROID_KHR # ifndef VK_USE_PLATFORM_ANDROID_KHR
# define VK_USE_PLATFORM_ANDROID_KHR
# endif
#else
# undef VK_USE_PLATFORM_ANDROID_KHR
#endif // defined(DAWN_PLATFORM_ANDROID) #endif // defined(DAWN_PLATFORM_ANDROID)
#if defined(DAWN_PLATFORM_FUCHSIA) #if defined(DAWN_PLATFORM_FUCHSIA)
# define VK_USE_PLATFORM_FUCHSIA # ifndef VK_USE_PLATFORM_FUCHSIA
# define VK_USE_PLATFORM_FUCHSIA
# endif
#else
# undef VK_USE_PLATFORM_FUCHSIA
#endif // defined(DAWN_PLATFORM_FUCHSIA) #endif // defined(DAWN_PLATFORM_FUCHSIA)
// The actual inclusion of vulkan.h! // The actual inclusion of vulkan.h!

View File

@ -571,7 +571,7 @@ source_set("sources") {
} }
if (dawn_enable_vulkan) { if (dawn_enable_vulkan) {
public_deps += [ "${dawn_root}/third_party/khronos:vulkan_headers" ] public_deps += [ "${dawn_vulkan_headers_dir}:vulkan_headers" ]
sources += [ sources += [
"vulkan/AdapterVk.cpp", "vulkan/AdapterVk.cpp",
"vulkan/AdapterVk.h", "vulkan/AdapterVk.h",