[tint][fuzzers] Skip over unsupported extensions
Change-Id: I749f780e178a8fd62080c8e93daeee19da21c897
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/140990
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/fuzzers/tint_ir_roundtrip_fuzzer.cc b/src/tint/fuzzers/tint_ir_roundtrip_fuzzer.cc
index 438ec91..352ea6f 100644
--- a/src/tint/fuzzers/tint_ir_roundtrip_fuzzer.cc
+++ b/src/tint/fuzzers/tint_ir_roundtrip_fuzzer.cc
@@ -46,6 +46,26 @@
return 0;
}
+ auto is_unsupported = [](const tint::ast::Enable* enable) {
+ for (auto ext : enable->extensions) {
+ switch (ext->name) {
+ case tint::builtin::Extension::kChromiumExperimentalDp4A:
+ case tint::builtin::Extension::kChromiumExperimentalFullPtrParameters:
+ case tint::builtin::Extension::kChromiumExperimentalPushConstant:
+ case tint::builtin::Extension::kChromiumInternalDualSourceBlending:
+ case tint::builtin::Extension::kChromiumInternalRelaxedUniformLayout:
+ return true;
+ default:
+ break;
+ }
+ }
+ return false;
+ };
+
+ if (src.AST().Enables().Any(is_unsupported)) {
+ return 0;
+ }
+
src = tint::fuzzers::ApplySubstituteOverrides(std::move(src));
if (!src.IsValid()) {
return 0;