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:
parent
c3cc75067e
commit
585f395e66
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue