Cleanup transform usage

Use tint::transform::DataMap for inputs as well as outputs.

This allows tint to nest transforms inside each other (e.g. embedding
transforms inside sanitizers), and still having a consistent way to pass
data in and out of these transforms, regardless of nesting depth.

Transforms can also now be fully pre-built and used multiple times as
there is no state held by the transform itself.

Bug: tint:389

Change-Id: If1616c77f2776be449021a32f4a6b0b89159aa2a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48060
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-04-19 19:42:19 +00:00
committed by Commit Bot service account
parent eae70b75ae
commit 8091c68450
8 changed files with 91 additions and 81 deletions

View File

@@ -160,7 +160,7 @@ TEST_F(ShaderModuleValidationTest, MultisampledArrayTexture) {
}
// Tests that shader module compilation messages can be queried.
TEST_F(ShaderModuleValidationTest, CompilationMessages) {
TEST_F(ShaderModuleValidationTest, GetCompilationMessages) {
// This test works assuming ShaderModule is backed by a dawn_native::ShaderModuleBase, which
// is not the case on the wire.
DAWN_SKIP_TEST_IF(UsesWire());
@@ -172,12 +172,11 @@ TEST_F(ShaderModuleValidationTest, CompilationMessages) {
dawn_native::ShaderModuleBase* shaderModuleBase =
reinterpret_cast<dawn_native::ShaderModuleBase*>(shaderModule.Get());
shaderModuleBase->CompilationMessages()->ClearMessages();
shaderModuleBase->CompilationMessages()->AddMessage("Info Message");
shaderModuleBase->CompilationMessages()->AddMessage("Warning Message",
wgpu::CompilationMessageType::Warning);
shaderModuleBase->CompilationMessages()->AddMessage("Error Message",
wgpu::CompilationMessageType::Error, 3, 4);
dawn_native::OwnedCompilationMessages* messages = shaderModuleBase->GetCompilationMessages();
messages->ClearMessages();
messages->AddMessage("Info Message");
messages->AddMessage("Warning Message", wgpu::CompilationMessageType::Warning);
messages->AddMessage("Error Message", wgpu::CompilationMessageType::Error, 3, 4);
auto callback = [](WGPUCompilationInfoRequestStatus status, const WGPUCompilationInfo* info,
void* userdata) {