Simplify MultiplanarExternalTexture::ShouldRun.

Currently the multiplanar `ShouldRun` function is scanning all objects
looking for an external texture. This CL switches to using the type
manager and attempts to find an `ExternalTexture` type in the system. If
found, then the transform should run.

Change-Id: I28b8fa1835a83f2bff5d804e95bcbaa73d3d2124
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126922
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2023-04-12 00:44:20 +00:00 committed by Dawn LUCI CQ
parent c3cc75067e
commit 585f395e66
1 changed files with 2 additions and 8 deletions

View File

@ -33,14 +33,8 @@ namespace tint::transform {
namespace { namespace {
bool ShouldRun(const Program* program) { bool ShouldRun(const Program* program) {
for (auto* node : program->ASTNodes().Objects()) { auto ext = program->Types().Find<type::ExternalTexture>();
if (auto* expr = node->As<ast::Expression>()) { return ext != nullptr;
if (Is<type::ExternalTexture>(program->TypeOf(expr))) {
return true;
}
}
}
return false;
} }
/// This struct stores symbols for new bindings created as a result of transforming a /// This struct stores symbols for new bindings created as a result of transforming a