From b1f9f9fd8efa9ba71f7f967d6b82b3683332c91f Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 31 May 2022 17:28:49 +0000 Subject: [PATCH] Ensure the Vulkan fuzzer uses SwiftShader Some bug reports have come in using lavapipe which is not a conformant Vulkan implementation that we care about fuzzing. Bug: chromium:1330453, chromium:1330389 Change-Id: I219103c30ca30702c8f3ccd6eebe87b90a10b6d2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92121 Auto-Submit: Austin Eng Reviewed-by: Corentin Wallez Commit-Queue: Austin Eng Commit-Queue: Corentin Wallez Kokoro: Kokoro --- src/dawn/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dawn/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp b/src/dawn/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp index 6b18929ea7..36ac282936 100644 --- a/src/dawn/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp +++ b/src/dawn/fuzzers/DawnWireServerAndVulkanBackendFuzzer.cpp @@ -15,6 +15,7 @@ #include #include "DawnWireServerFuzzer.h" +#include "dawn/common/GPUInfo.h" #include "dawn/native/DawnNative.h" #include "testing/libfuzzer/libfuzzer_exports.h" @@ -29,8 +30,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { wgpu::AdapterProperties properties; adapter.GetProperties(&properties); - return properties.backendType == wgpu::BackendType::Vulkan && - properties.adapterType == wgpu::AdapterType::CPU; + return gpu_info::IsGoogleSwiftshader(properties.vendorID, properties.deviceID); }, true /* supportsErrorInjection */); }