From c368339da1a841c3ffdf63cbbcfc88f341d11dd9 Mon Sep 17 00:00:00 2001 From: James Price Date: Fri, 13 May 2022 19:04:24 +0000 Subject: [PATCH] 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 Kokoro: Kokoro --- src/dawn/native/ShaderModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dawn/native/ShaderModule.cpp b/src/dawn/native/ShaderModule.cpp index 70419f1f15..43fb89e017 100644 --- a/src/dawn/native/ShaderModule.cpp +++ b/src/dawn/native/ShaderModule.cpp @@ -380,8 +380,8 @@ ResultOrError ParseWGSL(const tint::Source::File* file, outMessages->AddMessages(program.Diagnostics()); } if (!program.IsValid()) { - return DAWN_FORMAT_VALIDATION_ERROR("Tint WGSL reader failure:\nParser: %s\nShader:\n%s\n", - program.Diagnostics().str(), file->content.data); + return DAWN_FORMAT_VALIDATION_ERROR("Tint WGSL reader failure: %s\n", + program.Diagnostics().str()); } return std::move(program);