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>
diff --git a/scripts/dawn_features.gni b/scripts/dawn_features.gni
index 924f240..117c661 100644
--- a/scripts/dawn_features.gni
+++ b/scripts/dawn_features.gni
@@ -26,6 +26,9 @@
}
}
+# Enable the compilation for UWP
+dawn_is_winuwp = is_win && target_os == "winuwp"
+
declare_args() {
dawn_use_angle = true
@@ -62,8 +65,9 @@
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 @@
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