Rework all transforms to transform-on-copy

instead of transform-in-place.

This is a public API breaking change, so I've added the `DAWN_USE_NEW_TINT_TRANSFORM_API` define which is used by Dawn to know which API to use.

As we're going to have to go through the effort of an API breaking change, use this as an opportunity to rename Transformer to Transform, and remove 'Transform' from each of the transforms themselves (they're already in the transform namespace).

Bug: tint:390
Bug: tint:389
Change-Id: I1017507524b76bb4ffd26b95e550ef53ddc891c9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34800
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2020-12-04 09:06:09 +00:00
committed by Commit Bot service account
parent 0f37afb74e
commit 00b77a80ab
25 changed files with 1210 additions and 1317 deletions

View File

@@ -84,10 +84,18 @@ class List {
/// adds a diagnostic to the end of this list.
/// @param diag the diagnostic to append to this list.
void add(Diagnostic&& diag) {
entries_.emplace_back(std::move(diag));
if (diag.severity >= Severity::Error) {
error_count_++;
}
entries_.emplace_back(std::move(diag));
}
/// adds a list of diagnostics to the end of this list.
/// @param list the diagnostic to append to this list.
void add(const List& list) {
for (auto diag : list) {
add(std::move(diag));
}
}
/// @returns true iff the diagnostic list contains errors diagnostics (or of