Add UWP support

Add necessary cflags and cflags_cc for winrt compilation.
Add 'dawn_is_winuwp'.
Set 'dawn_enable_vulkan' and 'dawn_supports_glfw_for_windowing' when compiling for UWP.
Link d3d12, d3d11 and dxgi stub libs when compiling for UWP.
Use LoadPackagedLibrary instead of LoadLibraryA in DynamicLib when compiling for UWP.

Swapchain related changes will be in another commit.

Bug: dawn:766
Change-Id: I1210798a21cc175bab77281403d262d4bfb02d99
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48480
Commit-Queue: 陈俊嘉 <cjj19970505@live.cn>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
This commit is contained in:
陈俊嘉
2021-04-23 02:16:12 +00:00
committed by Commit Bot service account
parent e6a12d5efa
commit 02336e6f99
9 changed files with 89 additions and 8 deletions

View File

@@ -26,6 +26,9 @@ if (build_with_chromium) {
}
}
# Enable the compilation for UWP
dawn_is_winuwp = is_win && target_os == "winuwp"
declare_args() {
dawn_use_angle = true
@@ -62,8 +65,9 @@ declare_args() {
dawn_enable_opengl = is_linux && !is_chromeos
# Enables the compilation of Dawn's Vulkan backend
dawn_enable_vulkan = is_linux || is_chromeos || is_win || is_fuchsia ||
is_android || dawn_use_swiftshader
# Disables vulkan when compiling for UWP, since UWP only supports d3d
dawn_enable_vulkan = is_linux || is_chromeos || (is_win && !dawn_is_winuwp) ||
is_fuchsia || is_android || dawn_use_swiftshader
# Enable use of reflection compiler in spirv-cross. This is needed
# if performing reflection on systems that the platform language
@@ -90,5 +94,6 @@ declare_args() {
dawn_enable_vulkan_loader = dawn_enable_vulkan && is_mac
}
# UWP only supports CoreWindow for windowing
dawn_supports_glfw_for_windowing =
is_win || (is_linux && !is_chromeos) || is_mac
(is_win && !dawn_is_winuwp) || (is_linux && !is_chromeos) || is_mac