Skip to content

Commit 6ce1be5

Browse files
y-novikovCommit Bot
authored and
Commit Bot
committed
Vulkan: move platform defines to Vulkan Headers build file.
From angle_vulkan build target, so that everyone including Vulkan Headers would get them for the right platform. Also remove obsolete defines. Bug: angleproject:3279 Change-Id: I4bbbeb72acfbf0dd22a1d6a13bd9df7ddaec84dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1530029 Reviewed-by: Jamie Madill <[email protected]> Reviewed-by: Tobin Ehlis <[email protected]> Commit-Queue: Yuly Novikov <[email protected]>
1 parent c2074b1 commit 6ce1be5

File tree

3 files changed

+13
-27
lines changed

3 files changed

+13
-27
lines changed

BUILD.gn

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -497,28 +497,9 @@ config("libANGLE_config") {
497497

498498
if (angle_enable_vulkan) {
499499
config("vulkan_config") {
500-
if (is_win) {
501-
defines = [
502-
"VK_USE_PLATFORM_WIN32_KHR",
503-
"VK_USE_PLATFORM_WIN32_KHX",
504-
]
505-
}
506-
if (is_linux) {
507-
defines = [
508-
"VK_USE_PLATFORM_XCB_KHR",
509-
"VK_USE_PLATFORM_XCB_KHX",
510-
]
511-
}
512500
if (is_android) {
513-
defines = [
514-
"VK_USE_PLATFORM_ANDROID_KHR",
515-
"VK_USE_PLATFORM_ANDROID_KHX",
516-
]
517501
libs = [ "vulkan" ]
518502
}
519-
if (is_fuchsia) {
520-
defines = [ "VK_USE_PLATFORM_FUCHSIA" ]
521-
}
522503
}
523504

524505
# Use this target to include everything ANGLE needs for Vulkan.

src/tests/test_utils/third_party/vulkan_command_buffer_utils.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,17 @@ ANGLE_DISABLE_EXTRA_SEMI_WARNING
4040

4141
ANGLE_REENABLE_EXTRA_SEMI_WARNING
4242

43-
#if defined(__linux__) && !defined(__ANDROID__)
44-
# define VK_USE_PLATFORM_XCB_KHR
45-
#endif
46-
4743
#ifdef _WIN32
4844
# pragma comment(linker, "/subsystem:console")
4945
# ifndef WIN32_LEAN_AND_MEAN
5046
# define WIN32_LEAN_AND_MEAN
5147
# endif
52-
# ifndef VK_USE_PLATFORM_WIN32_KHR
53-
# define VK_USE_PLATFORM_WIN32_KHR
54-
# endif
5548
# ifndef NOMINMAX
5649
# define NOMINMAX /* Don't let Windows define min() or max() */
5750
# endif
5851
# define APP_NAME_STR_LEN 80
5952
#elif defined(__ANDROID__)
6053
// Include files for Android
61-
# define VK_USE_PLATFORM_ANDROID_KHR
6254
# include <android/log.h>
6355
# include <unistd.h>
6456
# include "util/OSWindow.h"

third_party/vulkan-headers/BUILD.gn

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ import("../../gni/angle.gni")
1010

1111
config("vulkan_headers_config") {
1212
include_dirs = [ "src/include" ]
13+
14+
if (is_win) {
15+
defines = [ "VK_USE_PLATFORM_WIN32_KHR" ]
16+
}
17+
if (is_linux) {
18+
defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
19+
}
20+
if (is_android) {
21+
defines = [ "VK_USE_PLATFORM_ANDROID_KHR" ]
22+
}
23+
if (is_fuchsia) {
24+
defines = [ "VK_USE_PLATFORM_FUCHSIA" ]
25+
}
1326
}
1427

1528
# Vulkan headers only, no compiled sources.

0 commit comments

Comments
 (0)