Use Tint as much as possible in fuzzers.

Force the use_tint_generator toggle so that Tint is used as much as
possible in fuzzers to get coverage of the relevant code.

This will also fix a recurring fuzzer issue that required a code
transform that only exists in the Tint path: bindings must be renumbered
otherwise we hit an integer overflow in Swiftshader's descriptor set
writes.

Bug: chromium:1209602
Change-Id: Ie868fb07306f96a8ecf42a687313e0a466041a45
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51240
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
Corentin Wallez 2021-05-17 15:37:18 +00:00 committed by Commit Bot service account
parent e8c271dab7
commit 3148e83cff
3 changed files with 18 additions and 3 deletions

View File

@ -34,7 +34,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (properties.backendType == wgpu::BackendType::D3D12 &&
properties.adapterType == wgpu::AdapterType::CPU) {
device = wgpu::Device::Acquire(adapter.CreateDevice());
// Force usage of Tint to provide coverage of that code path until it becomes
// the default.
dawn_native::DeviceDescriptor desc;
desc.forceEnabledToggles.push_back("use_tint_generator");
device = wgpu::Device::Acquire(adapter.CreateDevice(&desc));
break;
}
}

View File

@ -34,7 +34,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
adapter.GetProperties(&properties);
if (properties.backendType == wgpu::BackendType::Null) {
nullDevice = wgpu::Device::Acquire(adapter.CreateDevice());
// Force usage of Tint to provide coverage of that code path until it becomes
// the default.
dawn_native::DeviceDescriptor desc;
desc.forceEnabledToggles.push_back("use_tint_generator");
nullDevice = wgpu::Device::Acquire(adapter.CreateDevice(&desc));
break;
}
}

View File

@ -34,7 +34,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (properties.backendType == wgpu::BackendType::Vulkan &&
properties.adapterType == wgpu::AdapterType::CPU) {
device = wgpu::Device::Acquire(adapter.CreateDevice());
// Force usage of Tint to provide coverage of that code path until it becomes
// the default.
dawn_native::DeviceDescriptor desc;
desc.forceEnabledToggles.push_back("use_tint_generator");
device = wgpu::Device::Acquire(adapter.CreateDevice(&desc));
break;
}
}