Commit 6ce1be5a by Yuly Novikov Committed by Commit Bot

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/+/1530029Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent c2074b14
...@@ -497,28 +497,9 @@ config("libANGLE_config") { ...@@ -497,28 +497,9 @@ config("libANGLE_config") {
if (angle_enable_vulkan) { if (angle_enable_vulkan) {
config("vulkan_config") { config("vulkan_config") {
if (is_win) {
defines = [
"VK_USE_PLATFORM_WIN32_KHR",
"VK_USE_PLATFORM_WIN32_KHX",
]
}
if (is_linux) {
defines = [
"VK_USE_PLATFORM_XCB_KHR",
"VK_USE_PLATFORM_XCB_KHX",
]
}
if (is_android) { if (is_android) {
defines = [
"VK_USE_PLATFORM_ANDROID_KHR",
"VK_USE_PLATFORM_ANDROID_KHX",
]
libs = [ "vulkan" ] libs = [ "vulkan" ]
} }
if (is_fuchsia) {
defines = [ "VK_USE_PLATFORM_FUCHSIA" ]
}
} }
# Use this target to include everything ANGLE needs for Vulkan. # Use this target to include everything ANGLE needs for Vulkan.
......
...@@ -40,25 +40,17 @@ ANGLE_DISABLE_EXTRA_SEMI_WARNING ...@@ -40,25 +40,17 @@ ANGLE_DISABLE_EXTRA_SEMI_WARNING
ANGLE_REENABLE_EXTRA_SEMI_WARNING ANGLE_REENABLE_EXTRA_SEMI_WARNING
#if defined(__linux__) && !defined(__ANDROID__)
# define VK_USE_PLATFORM_XCB_KHR
#endif
#ifdef _WIN32 #ifdef _WIN32
# pragma comment(linker, "/subsystem:console") # pragma comment(linker, "/subsystem:console")
# ifndef WIN32_LEAN_AND_MEAN # ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# endif # endif
# ifndef VK_USE_PLATFORM_WIN32_KHR
# define VK_USE_PLATFORM_WIN32_KHR
# endif
# ifndef NOMINMAX # ifndef NOMINMAX
# define NOMINMAX /* Don't let Windows define min() or max() */ # define NOMINMAX /* Don't let Windows define min() or max() */
# endif # endif
# define APP_NAME_STR_LEN 80 # define APP_NAME_STR_LEN 80
#elif defined(__ANDROID__) #elif defined(__ANDROID__)
// Include files for Android // Include files for Android
# define VK_USE_PLATFORM_ANDROID_KHR
# include <android/log.h> # include <android/log.h>
# include <unistd.h> # include <unistd.h>
# include "util/OSWindow.h" # include "util/OSWindow.h"
......
...@@ -10,6 +10,19 @@ import("../../gni/angle.gni") ...@@ -10,6 +10,19 @@ import("../../gni/angle.gni")
config("vulkan_headers_config") { config("vulkan_headers_config") {
include_dirs = [ "src/include" ] include_dirs = [ "src/include" ]
if (is_win) {
defines = [ "VK_USE_PLATFORM_WIN32_KHR" ]
}
if (is_linux) {
defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
}
if (is_android) {
defines = [ "VK_USE_PLATFORM_ANDROID_KHR" ]
}
if (is_fuchsia) {
defines = [ "VK_USE_PLATFORM_FUCHSIA" ]
}
} }
# Vulkan headers only, no compiled sources. # Vulkan headers only, no compiled sources.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment