Simplify tint API usage

A whole lot of public API tint changes have been made to simplify usage of the library.
Big changes include:
* Type determination is now implicit
* Generators no longer take ownership of programs, so they don't need to be cloned.

Change-Id: Icac0956ae120ae4e6a9d0290b2478c0fbc3bcf22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/39341
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Ben Clayton
2021-02-02 15:38:39 +00:00
committed by Commit Bot service account
parent 199ba447c5
commit 401aad5878
2 changed files with 22 additions and 67 deletions

View File

@@ -73,23 +73,12 @@ namespace DawnSPIRVCrossFuzzer {
// Using Tint SPIRV->SPIRV to normalize inputs if supported.
#ifdef DAWN_ENABLE_WGSL
tint::reader::spirv::Parser parser(input);
if (!parser.Parse()) {
return 0;
}
tint::Program program = parser.program();
tint::Program program = tint::reader::wgsl::Parse(file);
if (!program.IsValid()) {
return 0;
}
tint::TypeDeterminer type_determiner(&program);
if (!type_determiner.Determine()) {
return 0;
}
tint::writer::spirv::Generator generator(&program);
tint::writer::spirv::Generator generator(&program);
if (!generator.Generate()) {
return 0;
}