Output WGSL instead of SPIR-V in transform fuzzers

Generating SPIR-V can cause validation failures when out-of-bounds
accesses are performed, since we are not running the robustness
transform.

Bug: chromium:1246061
Change-Id: Ied58d77d90079d10d5579d2d55854c3cfbc18db5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/63640
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
James Price 2021-09-08 18:08:36 +00:00 committed by Tint LUCI CQ
parent b7bcbf0d20
commit 5910ec1e8a
7 changed files with 7 additions and 7 deletions

View File

@ -30,7 +30,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
transform_manager.Add<tint::transform::BindingRemapper>(); transform_manager.Add<tint::transform::BindingRemapper>();
fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL);
fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs));
fuzzer.SetDumpInput(GetCliParams().dump_input); fuzzer.SetDumpInput(GetCliParams().dump_input);

View File

@ -30,7 +30,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
transform_manager.Add<tint::transform::FirstIndexOffset>(); transform_manager.Add<tint::transform::FirstIndexOffset>();
tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL);
fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs));
fuzzer.SetDumpInput(GetCliParams().dump_input); fuzzer.SetDumpInput(GetCliParams().dump_input);

View File

@ -23,7 +23,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
transform::DataMap transform_inputs; transform::DataMap transform_inputs;
transform_manager.Add<transform::Robustness>(); transform_manager.Add<transform::Robustness>();
tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL);
fuzzer.EnableInspector(); fuzzer.EnableInspector();
fuzzer.SetDumpInput(GetCliParams().dump_input); fuzzer.SetDumpInput(GetCliParams().dump_input);
fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs));

View File

@ -22,7 +22,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
transform::Manager transform_manager; transform::Manager transform_manager;
transform_manager.Add<transform::Renamer>(); transform_manager.Add<transform::Renamer>();
fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL);
fuzzer.SetTransformManager(&transform_manager, {}); fuzzer.SetTransformManager(&transform_manager, {});
fuzzer.SetDumpInput(GetCliParams().dump_input); fuzzer.SetDumpInput(GetCliParams().dump_input);

View File

@ -22,7 +22,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
tint::transform::Manager transform_manager; tint::transform::Manager transform_manager;
transform_manager.Add<tint::transform::Robustness>(); transform_manager.Add<tint::transform::Robustness>();
tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL);
fuzzer.SetTransformManager(&transform_manager, {}); fuzzer.SetTransformManager(&transform_manager, {});
fuzzer.SetDumpInput(GetCliParams().dump_input); fuzzer.SetDumpInput(GetCliParams().dump_input);

View File

@ -30,7 +30,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
transform_manager.Add<tint::transform::SingleEntryPoint>(); transform_manager.Add<tint::transform::SingleEntryPoint>();
tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL);
fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs));
fuzzer.SetDumpInput(GetCliParams().dump_input); fuzzer.SetDumpInput(GetCliParams().dump_input);

View File

@ -30,7 +30,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
transform_manager.Add<tint::transform::VertexPulling>(); transform_manager.Add<tint::transform::VertexPulling>();
tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL);
fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs));
fuzzer.SetDumpInput(GetCliParams().dump_input); fuzzer.SetDumpInput(GetCliParams().dump_input);