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 <enga@chromium.org>
Commit-Queue: Brian Ho <hob@chromium.org>
This commit is contained in:
Brian Ho 2019-11-20 20:31:31 +00:00 committed by Commit Bot service account
parent 8f3dc5836b
commit 858f93b86f
1 changed files with 1 additions and 1 deletions

View File

@ -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
}
}