From c3609d224afd8509f03ef35c792448b750a9d20c Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Wed, 8 Jan 2020 22:59:47 +0000 Subject: [PATCH] Reland "Use Swiftshader by default when fuzzing" This is a reland of d08a14b70982a90423f4965ae5625847316de09e It gates dawn_use_swiftshader on dawn_enable_vulkan because the Vulkan backend isn't supported on Mac. We may support Swiftshader Vulkan on Mac in the future, but that will first require changes to how we initialize the Vulkan backend. Original change's description: > Use Swiftshader by default when fuzzing > > Note: This still requires Chromium to have set dawn_swiftshader_dir > to take effect. > > Bug: dawn:295 > Change-Id: I0c953196630dd2694f68d290e6f3f1e427c20a2f > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14821 > Reviewed-by: Corentin Wallez > Reviewed-by: Kai Ninomiya > Commit-Queue: Austin Eng Bug: dawn:295 Change-Id: Ia125005b35951021702104a99a78712bcd47dd1e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14941 Reviewed-by: Kai Ninomiya Commit-Queue: Austin Eng --- scripts/dawn_features.gni | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/dawn_features.gni b/scripts/dawn_features.gni index 7cbb82f444..c82d22827c 100644 --- a/scripts/dawn_features.gni +++ b/scripts/dawn_features.gni @@ -51,13 +51,6 @@ declare_args() { # compiler, since it is a sub-class of if. dawn_enable_cross_reflection = false - # Enables usage of swiftshader on the Vulkan backend. - # Note that this will only work in standalone and in projects that set the - # dawn_swiftshader_dir variable in build_overrides/dawn.gni - # Because of how the Vulkan loader works, setting this make Dawn only able - # to find the Swiftshader ICD and not the others. - dawn_use_swiftshader = false - # Enables error injection for faking failures to native API calls dawn_enable_error_injection = is_debug || (build_with_chromium && use_fuzzing_engine) @@ -67,6 +60,15 @@ declare_args() { # Put them in two separate declare_args() when setting the value of one # argument based on another. declare_args() { + # Enables usage of swiftshader on the Vulkan backend. + # Note that this will only work in standalone and in projects that set the + # dawn_swiftshader_dir variable in build_overrides/dawn.gni + # Because of how the Vulkan loader works, setting this make Dawn only able + # to find the Swiftshader ICD and not the others. + # Enabled by default when fuzzing. + dawn_use_swiftshader = + dawn_enable_vulkan && build_with_chromium && use_fuzzing_engine + # Uses our built version of Vulkan validation layers dawn_enable_vulkan_validation_layers = dawn_enable_vulkan && ((is_linux && !is_chromeos) || is_win)