[tint][wgsl/writer] Print even on diagnostic errors
The WGSL writer is used to print the WGSL of invalid programs. As such, it shouldn't bail if Program::IsValid() return false.
Change-Id: Ia49bae8c17400aa2026010626b63ffefc8b18ad2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/150820
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/lang/wgsl/writer/writer.cc b/src/tint/lang/wgsl/writer/writer.cc
index 0c08e52..1a7204a 100644
--- a/src/tint/lang/wgsl/writer/writer.cc
+++ b/src/tint/lang/wgsl/writer/writer.cc
@@ -29,10 +29,6 @@
Result<Output, std::string> Generate(const Program* program, const Options& options) {
(void)options;
- if (!program->IsValid()) {
- return std::string("input program is not valid");
- }
-
Output output;
#if TINT_BUILD_SYNTAX_TREE_WRITER
if (options.use_syntax_tree_writer) {