Remove WGSL source from validation messages

The shader source can be very large and this is causing excessively
large error messages that get truncated in some applications that use
Dawn native. We don't need to see the whole shader in the error
message.

Change-Id: I15ad7fa7814d19875a7c28b39e5fa9a24f265b98
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90161
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
James Price 2022-05-13 19:04:24 +00:00
parent 49385c99cc
commit c368339da1
1 changed files with 2 additions and 2 deletions

View File

@ -380,8 +380,8 @@ ResultOrError<tint::Program> ParseWGSL(const tint::Source::File* file,
outMessages->AddMessages(program.Diagnostics()); outMessages->AddMessages(program.Diagnostics());
} }
if (!program.IsValid()) { if (!program.IsValid()) {
return DAWN_FORMAT_VALIDATION_ERROR("Tint WGSL reader failure:\nParser: %s\nShader:\n%s\n", return DAWN_FORMAT_VALIDATION_ERROR("Tint WGSL reader failure: %s\n",
program.Diagnostics().str(), file->content.data); program.Diagnostics().str());
} }
return std::move(program); return std::move(program);