writer/wgsl: Handle ExternalTexture

Bug: dawn:728
Change-Id: Idda800c301ac88397aeeb4cd75d03d59a434c30f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53041
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2021-06-02 20:12:34 +00:00 committed by Tint LUCI CQ
parent e3cd216e29
commit f5163d01b5
1 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include "src/ast/bool_literal.h" #include "src/ast/bool_literal.h"
#include "src/ast/call_statement.h" #include "src/ast/call_statement.h"
#include "src/ast/depth_texture.h" #include "src/ast/depth_texture.h"
#include "src/ast/external_texture.h"
#include "src/ast/f32.h" #include "src/ast/f32.h"
#include "src/ast/float_literal.h" #include "src/ast/float_literal.h"
#include "src/ast/i32.h" #include "src/ast/i32.h"
@ -418,6 +419,8 @@ bool GeneratorImpl::EmitType(const ast::Type* ty) {
// The struct, as a type, is just the name. We should have already emitted // The struct, as a type, is just the name. We should have already emitted
// the declaration through a call to |EmitStructType| earlier. // the declaration through a call to |EmitStructType| earlier.
out_ << program_->Symbols().NameFor(str->name()); out_ << program_->Symbols().NameFor(str->name());
} else if (ty->Is<ast::ExternalTexture>()) {
out_ << "external_texture";
} else if (auto* texture = ty->As<ast::Texture>()) { } else if (auto* texture = ty->As<ast::Texture>()) {
out_ << "texture_"; out_ << "texture_";
if (texture->Is<ast::DepthTexture>()) { if (texture->Is<ast::DepthTexture>()) {