Make validation error formatting more consistent

- Updates error message formatting to ensure they end with a newline to
   prevent errors from running together.
 - Updated all encoder/device context messages to normalize their format
   and include more information.
 - Update Abseil formatter to make objects indicate if they are an error
   object in the formatted string. (ie: [Invalid BindGroup])
 - Added fallback code in case a context message doesn't format
   correctly to aid in debugging.

Bug: dawn:1154
Change-Id: Id27b11305cf8efcca343597f90489dde5552c775
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68200
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Brandon Jones
2021-11-03 01:31:19 +00:00
committed by Dawn LUCI CQ
parent 0a873d8eb1
commit 2514566d82
13 changed files with 90 additions and 73 deletions

View File

@@ -94,6 +94,9 @@ namespace dawn_native {
return {true};
}
s->Append("[");
if (value->IsError()) {
s->Append("Invalid ");
}
s->Append(ObjectTypeAsString(value->GetType()));
const std::string& label = value->GetLabel();
if (!label.empty()) {
@@ -112,6 +115,9 @@ namespace dawn_native {
return {true};
}
s->Append("[");
if (value->IsError()) {
s->Append("Invalid ");
}
s->Append(ObjectTypeAsString(value->GetType()));
const std::string& label = value->GetLabel();
if (!label.empty()) {