diff --git a/scripts/dawn_features.gni b/scripts/dawn_features.gni index 2ef8e15190..37a32a05c0 100644 --- a/scripts/dawn_features.gni +++ b/scripts/dawn_features.gni @@ -18,6 +18,16 @@ if (build_with_chromium) { import("//build/config/sanitizers/sanitizers.gni") } +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 makes Dawn only able + # to find the Swiftshader ICD and not the others. + # Enabled by default when fuzzing. + dawn_use_swiftshader = build_with_chromium && use_fuzzing_engine +} + declare_args() { # Enable Dawn's ASSERTs even in release builds dawn_always_assert = false @@ -42,7 +52,8 @@ declare_args() { dawn_enable_opengl = is_linux && !is_chromeos # Enables the compilation of Dawn's Vulkan backend - dawn_enable_vulkan = is_linux || is_win || is_fuchsia || is_android + dawn_enable_vulkan = + is_linux || is_win || 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 @@ -63,15 +74,6 @@ 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) diff --git a/src/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp b/src/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp index 54fc8cd5f6..b23b132e8c 100644 --- a/src/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp +++ b/src/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp @@ -15,6 +15,7 @@ #include "DawnWireServerFuzzer.h" #include "dawn_native/DawnNative.h" +#include "testing/libfuzzer/libfuzzer_exports.h" extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { return DawnWireServerFuzzer::Initialize(argc, argv);