From 858f93b86f5fbb91d160792618a206459e954d40 Mon Sep 17 00:00:00 2001 From: Brian Ho Date: Wed, 20 Nov 2019 20:31:31 +0000 Subject: [PATCH] Disable Vulkan validation layers on Chrome OS An earlier CL [1] enabled Vulkan validation layers on Linux which also enables validation layers on Chrome OS. Unfortunately, this changes breaks the Chrome OS build of Dawn: .../vulkan.h:63:10: fatal error: 'xcb/xcb.h' file not found This is because including the validation layers also includes the Vulkan-Headers repo which has a BUILD file that defines VK_USE_PLATFORM_XCB_KHR [2]. XCB (and all of X11, for that matter) is not supported on Chrome OS even though it is a Linux platform. This is a quick fix for the problem to unbreak the BUILD, but I think we should discuss what a long-term fix looks like. Do we send a patch to Khronos to add an "is_chromeos" branch to their BUILD file a la Fuchsia? Also, as mentioned by cwallez@ in a different CL of mine, we should really set up a Chrome OS trybot to catch these earlier. I can assign a bug to myself for that! [1] https://dawn-review.googlesource.com/c/dawn/+/13787 [2] https://github.com/KhronosGroup/Vulkan-Headers/blob/master/BUILD.gn#L23 Change-Id: Ic5fb4fa7990cc2232a7416145877e24b10a2a7b6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13880 Reviewed-by: Austin Eng Commit-Queue: Brian Ho --- scripts/dawn_features.gni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dawn_features.gni b/scripts/dawn_features.gni index 24e6f5aa46..cc1eb678a4 100644 --- a/scripts/dawn_features.gni +++ b/scripts/dawn_features.gni @@ -56,6 +56,6 @@ declare_args() { if (dawn_enable_vulkan) { declare_args() { # Uses our built version of Vulkan validation layers - dawn_enable_vulkan_validation_layers = is_linux || is_win + dawn_enable_vulkan_validation_layers = (is_linux && !is_chromeos) || is_win } }