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

@@ -113,6 +113,6 @@ Context messages should follow these guidelines:
* Example: `("validating % against %", descriptor, descriptor->layout)`
* Output: `- While validating [BindGroupDescriptor "Label"] against [BindGroupLayout]`
**When possible, indicate the function call being made as the top-level context.**
* Example: `("calling CreatePipelineLayout")`
* Output: `- While calling CreatePipelineLayout`
**When possible, indicate the function call being made as the top-level context, as well as the parameters passed.**
* Example: `("calling %s.CreatePipelineLayout(%s).", this, descriptor)`
* Output: `- While calling [Device].CreatePipelineLayout([PipelineLayoutDescriptor]).`