tint/ast: Remove ast::ExternalTexture
Instead use ast::TypeName. Bug: tint:1810 Change-Id: Ia1ae61b2bffd386f8958c8164e2223df5f8ac91c Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119121 Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Kokoro: Ben Clayton <bclayton@chromium.org> Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
parent
ed3389faee
commit
4906b03963
|
@ -270,7 +270,6 @@ libtint_source_set("libtint_syntax_tree_src") {
|
|||
"ast/enable.h",
|
||||
"ast/expression.h",
|
||||
"ast/extension.h",
|
||||
"ast/external_texture.h",
|
||||
"ast/float_literal_expression.h",
|
||||
"ast/for_loop_statement.h",
|
||||
"ast/function.h",
|
||||
|
@ -607,8 +606,6 @@ libtint_source_set("libtint_ast_src") {
|
|||
"ast/expression.h",
|
||||
"ast/extension.cc",
|
||||
"ast/extension.h",
|
||||
"ast/external_texture.cc",
|
||||
"ast/external_texture.h",
|
||||
"ast/float_literal_expression.cc",
|
||||
"ast/float_literal_expression.h",
|
||||
"ast/for_loop_statement.cc",
|
||||
|
@ -1318,7 +1315,6 @@ if (tint_build_unittests) {
|
|||
"ast/discard_statement_test.cc",
|
||||
"ast/enable_test.cc",
|
||||
"ast/extension_test.cc",
|
||||
"ast/external_texture_test.cc",
|
||||
"ast/float_literal_expression_test.cc",
|
||||
"ast/for_loop_statement_test.cc",
|
||||
"ast/function_test.cc",
|
||||
|
|
|
@ -142,8 +142,6 @@ list(APPEND TINT_LIB_SRCS
|
|||
ast/enable.h
|
||||
ast/expression.cc
|
||||
ast/expression.h
|
||||
ast/external_texture.cc
|
||||
ast/external_texture.h
|
||||
ast/float_literal_expression.cc
|
||||
ast/float_literal_expression.h
|
||||
ast/for_loop_statement.cc
|
||||
|
@ -841,7 +839,6 @@ if(TINT_BUILD_TESTS)
|
|||
ast/diagnostic_directive_test.cc
|
||||
ast/discard_statement_test.cc
|
||||
ast/enable_test.cc
|
||||
ast/external_texture_test.cc
|
||||
ast/float_literal_expression_test.cc
|
||||
ast/for_loop_statement_test.cc
|
||||
ast/function_test.cc
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "src/tint/ast/external_texture.h"
|
||||
|
||||
#include "src/tint/program_builder.h"
|
||||
#include "src/tint/type/texture_dimension.h"
|
||||
|
||||
TINT_INSTANTIATE_TYPEINFO(tint::ast::ExternalTexture);
|
||||
|
||||
namespace tint::ast {
|
||||
|
||||
// ExternalTexture::ExternalTexture() : Base(type::TextureDimension::k2d) {}
|
||||
ExternalTexture::ExternalTexture(ProgramID pid, NodeID nid, const Source& src)
|
||||
: Base(pid, nid, src, type::TextureDimension::k2d) {}
|
||||
|
||||
ExternalTexture::ExternalTexture(ExternalTexture&&) = default;
|
||||
|
||||
ExternalTexture::~ExternalTexture() = default;
|
||||
|
||||
std::string ExternalTexture::FriendlyName(const SymbolTable&) const {
|
||||
return "texture_external";
|
||||
}
|
||||
|
||||
const ExternalTexture* ExternalTexture::Clone(CloneContext* ctx) const {
|
||||
return ctx->dst->create<ExternalTexture>();
|
||||
}
|
||||
|
||||
} // namespace tint::ast
|
|
@ -1,50 +0,0 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef SRC_TINT_AST_EXTERNAL_TEXTURE_H_
|
||||
#define SRC_TINT_AST_EXTERNAL_TEXTURE_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "src/tint/ast/texture.h"
|
||||
|
||||
namespace tint::ast {
|
||||
|
||||
/// An external texture type
|
||||
class ExternalTexture final : public Castable<ExternalTexture, Texture> {
|
||||
public:
|
||||
/// Constructor
|
||||
/// @param pid the identifier of the program that owns this node
|
||||
/// @param nid the unique node identifier
|
||||
/// @param src the source of this node
|
||||
ExternalTexture(ProgramID pid, NodeID nid, const Source& src);
|
||||
|
||||
/// Move constructor
|
||||
ExternalTexture(ExternalTexture&&);
|
||||
~ExternalTexture() override;
|
||||
|
||||
/// @param symbols the program's symbol table
|
||||
/// @returns the name for this type that closely resembles how it would be
|
||||
/// declared in WGSL.
|
||||
std::string FriendlyName(const SymbolTable& symbols) const override;
|
||||
|
||||
/// Clones this type and all transitive types using the `CloneContext` `ctx`.
|
||||
/// @param ctx the clone context
|
||||
/// @return the newly cloned type
|
||||
const ExternalTexture* Clone(CloneContext* ctx) const override;
|
||||
};
|
||||
|
||||
} // namespace tint::ast
|
||||
|
||||
#endif // SRC_TINT_AST_EXTERNAL_TEXTURE_H_
|
|
@ -1,45 +0,0 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "src/tint/ast/external_texture.h"
|
||||
|
||||
#include "src/tint/ast/test_helper.h"
|
||||
#include "src/tint/type/texture_dimension.h"
|
||||
|
||||
namespace tint::ast {
|
||||
namespace {
|
||||
|
||||
using AstExternalTextureTest = TestHelper;
|
||||
|
||||
TEST_F(AstExternalTextureTest, IsTexture) {
|
||||
Texture* ty = create<ExternalTexture>();
|
||||
EXPECT_FALSE(ty->Is<DepthTexture>());
|
||||
EXPECT_TRUE(ty->Is<ExternalTexture>());
|
||||
EXPECT_FALSE(ty->Is<MultisampledTexture>());
|
||||
EXPECT_FALSE(ty->Is<SampledTexture>());
|
||||
EXPECT_FALSE(ty->Is<StorageTexture>());
|
||||
}
|
||||
|
||||
TEST_F(AstExternalTextureTest, Dim) {
|
||||
auto* ty = create<ExternalTexture>();
|
||||
EXPECT_EQ(ty->dim, type::TextureDimension::k2d);
|
||||
}
|
||||
|
||||
TEST_F(AstExternalTextureTest, FriendlyName) {
|
||||
auto* ty = create<ExternalTexture>();
|
||||
EXPECT_EQ(ty->FriendlyName(Symbols()), "texture_external");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace tint::ast
|
|
@ -170,6 +170,8 @@ enum builtin_type {
|
|||
// https://www.w3.org/TR/WGSL/#sampler-type
|
||||
sampler
|
||||
sampler_comparison
|
||||
// https://www.w3.org/TR/WGSL/#external-texture-type
|
||||
texture_external
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "src/tint/ast/discard_statement.h"
|
||||
#include "src/tint/ast/enable.h"
|
||||
#include "src/tint/ast/extension.h"
|
||||
#include "src/tint/ast/external_texture.h"
|
||||
#include "src/tint/ast/float_literal_expression.h"
|
||||
#include "src/tint/ast/for_loop_statement.h"
|
||||
#include "src/tint/ast/id_attribute.h"
|
||||
|
@ -1071,14 +1070,12 @@ class ProgramBuilder {
|
|||
}
|
||||
|
||||
/// @returns the external texture
|
||||
const ast::ExternalTexture* external_texture() const {
|
||||
return builder->create<ast::ExternalTexture>();
|
||||
}
|
||||
const ast::TypeName* external_texture() const { return external_texture(builder->source_); }
|
||||
|
||||
/// @param source the Source of the node
|
||||
/// @returns the external texture
|
||||
const ast::ExternalTexture* external_texture(const Source& source) const {
|
||||
return builder->create<ast::ExternalTexture>(source);
|
||||
/// @returns the external texture typename
|
||||
const ast::TypeName* external_texture(const Source& source) const {
|
||||
return (*this)(source, "texture_external");
|
||||
}
|
||||
|
||||
/// Constructs a TypeName for the type declaration.
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "src/tint/ast/call_statement.h"
|
||||
#include "src/tint/ast/continue_statement.h"
|
||||
#include "src/tint/ast/discard_statement.h"
|
||||
#include "src/tint/ast/external_texture.h"
|
||||
#include "src/tint/ast/id_attribute.h"
|
||||
#include "src/tint/ast/if_statement.h"
|
||||
#include "src/tint/ast/increment_decrement_statement.h"
|
||||
|
|
|
@ -2116,7 +2116,8 @@ class ResolverBuiltinTest_TextureOperation : public ResolverTestWithParam<Textur
|
|||
|
||||
void add_call_param(std::string name, const ast::Type* type, ExpressionList* call_params) {
|
||||
if (auto* type_name = type->As<ast::TypeName>()) {
|
||||
if (utils::HasPrefix(Symbols().NameFor(type_name->name->symbol), "sampler")) {
|
||||
auto n = Symbols().NameFor(type_name->name->symbol);
|
||||
if (utils::HasPrefix(n, "texture") || utils::HasPrefix(n, "sampler")) {
|
||||
GlobalVar(name, type, Binding(0_a), Group(0_a));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "src/tint/ast/depth_texture.h"
|
||||
#include "src/tint/ast/diagnostic_attribute.h"
|
||||
#include "src/tint/ast/discard_statement.h"
|
||||
#include "src/tint/ast/external_texture.h"
|
||||
#include "src/tint/ast/for_loop_statement.h"
|
||||
#include "src/tint/ast/id_attribute.h"
|
||||
#include "src/tint/ast/identifier.h"
|
||||
|
@ -405,8 +404,7 @@ class DependencyScanner {
|
|||
TraverseType(tex->type);
|
||||
},
|
||||
[&](Default) {
|
||||
if (!ty->IsAnyOf<ast::DepthTexture, ast::DepthMultisampledTexture,
|
||||
ast::ExternalTexture>()) {
|
||||
if (!ty->IsAnyOf<ast::DepthTexture, ast::DepthMultisampledTexture>()) {
|
||||
UnhandledNode(diagnostics_, ty);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
#include "src/tint/type/builtin.h"
|
||||
#include "src/tint/type/depth_multisampled_texture.h"
|
||||
#include "src/tint/type/depth_texture.h"
|
||||
#include "src/tint/type/external_texture.h"
|
||||
#include "src/tint/type/multisampled_texture.h"
|
||||
#include "src/tint/type/pointer.h"
|
||||
#include "src/tint/type/reference.h"
|
||||
|
@ -321,7 +322,6 @@ type::Type* Resolver::Type(const ast::Type* ty) {
|
|||
}
|
||||
return nullptr;
|
||||
},
|
||||
[&](const ast::ExternalTexture*) { return builder_->create<type::ExternalTexture>(); },
|
||||
[&](const ast::TypeName* t) -> type::Type* {
|
||||
Mark(t->name);
|
||||
|
||||
|
@ -2527,6 +2527,8 @@ type::Type* Resolver::BuiltinType(type::Builtin builtin_ty, const ast::Identifie
|
|||
return builder_->create<type::Sampler>(type::SamplerKind::kSampler);
|
||||
case type::Builtin::kSamplerComparison:
|
||||
return builder_->create<type::Sampler>(type::SamplerKind::kComparisonSampler);
|
||||
case type::Builtin::kTextureExternal:
|
||||
return builder_->create<type::ExternalTexture>();
|
||||
case type::Builtin::kUndefined:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ const ast::Type* Transform::CreateASTTypeFor(CloneContext& ctx, const type::Type
|
|||
return ctx.dst->create<ast::DepthMultisampledTexture>(t->dim());
|
||||
}
|
||||
if (ty->Is<type::ExternalTexture>()) {
|
||||
return ctx.dst->create<ast::ExternalTexture>();
|
||||
return ctx.dst->ty.external_texture();
|
||||
}
|
||||
if (auto* t = ty->As<type::MultisampledTexture>()) {
|
||||
return ctx.dst->create<ast::MultisampledTexture>(t->dim(),
|
||||
|
|
|
@ -100,6 +100,9 @@ Builtin ParseBuiltin(std::string_view str) {
|
|||
if (str == "sampler_comparison") {
|
||||
return Builtin::kSamplerComparison;
|
||||
}
|
||||
if (str == "texture_external") {
|
||||
return Builtin::kTextureExternal;
|
||||
}
|
||||
if (str == "u32") {
|
||||
return Builtin::kU32;
|
||||
}
|
||||
|
@ -194,6 +197,8 @@ std::ostream& operator<<(std::ostream& out, Builtin value) {
|
|||
return out << "sampler";
|
||||
case Builtin::kSamplerComparison:
|
||||
return out << "sampler_comparison";
|
||||
case Builtin::kTextureExternal:
|
||||
return out << "texture_external";
|
||||
case Builtin::kU32:
|
||||
return out << "u32";
|
||||
case Builtin::kVec2F:
|
||||
|
|
|
@ -54,6 +54,7 @@ enum class Builtin {
|
|||
kMat4X4H,
|
||||
kSampler,
|
||||
kSamplerComparison,
|
||||
kTextureExternal,
|
||||
kU32,
|
||||
kVec2F,
|
||||
kVec2H,
|
||||
|
@ -80,12 +81,43 @@ std::ostream& operator<<(std::ostream& out, Builtin value);
|
|||
Builtin ParseBuiltin(std::string_view str);
|
||||
|
||||
constexpr const char* kBuiltinStrings[] = {
|
||||
"bool", "f16", "f32", "i32", "mat2x2f", "mat2x2h",
|
||||
"mat2x3f", "mat2x3h", "mat2x4f", "mat2x4h", "mat3x2f", "mat3x2h",
|
||||
"mat3x3f", "mat3x3h", "mat3x4f", "mat3x4h", "mat4x2f", "mat4x2h",
|
||||
"mat4x3f", "mat4x3h", "mat4x4f", "mat4x4h", "sampler", "sampler_comparison",
|
||||
"u32", "vec2f", "vec2h", "vec2i", "vec2u", "vec3f",
|
||||
"vec3h", "vec3i", "vec3u", "vec4f", "vec4h", "vec4i",
|
||||
"bool",
|
||||
"f16",
|
||||
"f32",
|
||||
"i32",
|
||||
"mat2x2f",
|
||||
"mat2x2h",
|
||||
"mat2x3f",
|
||||
"mat2x3h",
|
||||
"mat2x4f",
|
||||
"mat2x4h",
|
||||
"mat3x2f",
|
||||
"mat3x2h",
|
||||
"mat3x3f",
|
||||
"mat3x3h",
|
||||
"mat3x4f",
|
||||
"mat3x4h",
|
||||
"mat4x2f",
|
||||
"mat4x2h",
|
||||
"mat4x3f",
|
||||
"mat4x3h",
|
||||
"mat4x4f",
|
||||
"mat4x4h",
|
||||
"sampler",
|
||||
"sampler_comparison",
|
||||
"texture_external",
|
||||
"u32",
|
||||
"vec2f",
|
||||
"vec2h",
|
||||
"vec2i",
|
||||
"vec2u",
|
||||
"vec3f",
|
||||
"vec3h",
|
||||
"vec3i",
|
||||
"vec3u",
|
||||
"vec4f",
|
||||
"vec4h",
|
||||
"vec4i",
|
||||
"vec4u",
|
||||
};
|
||||
|
||||
|
|
|
@ -199,97 +199,104 @@ void BuiltinParser(::benchmark::State& state) {
|
|||
"samplpLL_comparisI",
|
||||
"smplerfomparison",
|
||||
"sYmpURDr_comprison",
|
||||
"u3h",
|
||||
"IIq",
|
||||
"u3H",
|
||||
"texturh_external",
|
||||
"teqtureuIIextnal",
|
||||
"texture_externaH",
|
||||
"texture_external",
|
||||
"texre_externaQvv",
|
||||
"te66ue_external",
|
||||
"textue_e7tOrnal",
|
||||
"550DD",
|
||||
"II3H",
|
||||
"u3",
|
||||
"u32",
|
||||
"Qvv",
|
||||
"66",
|
||||
"73",
|
||||
"ve055DD",
|
||||
"IIec2f",
|
||||
"vec2",
|
||||
"r2",
|
||||
"u3l",
|
||||
"uGt",
|
||||
"ey2f",
|
||||
"vc2f",
|
||||
"IIeBB2f",
|
||||
"vec2f",
|
||||
"rec2",
|
||||
"lec2f",
|
||||
"GeJ2f",
|
||||
"ey2h",
|
||||
"vc2h",
|
||||
"IIeBB2h",
|
||||
"vec2h",
|
||||
"TTec338",
|
||||
"veUUSS2nnd",
|
||||
"vZx5CC",
|
||||
"kkec2q",
|
||||
"v005ii",
|
||||
"vnIIc2i",
|
||||
"vec2i",
|
||||
"v005ih",
|
||||
"vnIIc2h",
|
||||
"vec2h",
|
||||
"cceW",
|
||||
"cKK",
|
||||
"vec66i",
|
||||
"vec66h",
|
||||
"vePPK",
|
||||
"vexxu",
|
||||
"qec2u",
|
||||
"vec2u",
|
||||
"vexxi",
|
||||
"qec2i",
|
||||
"vec2i",
|
||||
"veSyMMr",
|
||||
"v2u",
|
||||
"ec",
|
||||
"5eFF3f",
|
||||
"5eFF2u",
|
||||
"rrecz44",
|
||||
"vWW",
|
||||
"vec3f",
|
||||
"vec2u",
|
||||
"XJecCZZ",
|
||||
"vePP3",
|
||||
"vec3c",
|
||||
"ve6ll3h",
|
||||
"vePP2",
|
||||
"vec2c",
|
||||
"ve6ll3f",
|
||||
"vcyy99",
|
||||
"Jec3KK",
|
||||
"vec3h",
|
||||
"vec3f",
|
||||
"_ex3",
|
||||
"Ky3",
|
||||
"zek3h",
|
||||
"veKSi",
|
||||
"vc3i",
|
||||
"zek3f",
|
||||
"veKSh",
|
||||
"vc3h",
|
||||
"ec3VV",
|
||||
"vec3i",
|
||||
"IAAc3i",
|
||||
"vec3h",
|
||||
"IAAc3h",
|
||||
"jbR",
|
||||
"veY4",
|
||||
"ec3u",
|
||||
"ec3i",
|
||||
"vc911",
|
||||
"mmccu",
|
||||
"vec3u",
|
||||
"vJJcu",
|
||||
"mmcci",
|
||||
"vec3i",
|
||||
"vJJci",
|
||||
"lDDcUfC",
|
||||
"vec3g",
|
||||
"CCe",
|
||||
"ec4f",
|
||||
"vIc__f",
|
||||
"vec4f",
|
||||
"ec3u",
|
||||
"vIc__u",
|
||||
"vec3u",
|
||||
"ePPtt",
|
||||
"v3dc4f",
|
||||
"vcyyf",
|
||||
"v3dc3u",
|
||||
"vcyyu",
|
||||
"u4",
|
||||
"v03nnh",
|
||||
"v03nnf",
|
||||
"Cuuecnv",
|
||||
"vec4h",
|
||||
"vec4f",
|
||||
"vX4ll",
|
||||
"vocpph",
|
||||
"vocppf",
|
||||
"vwwc4",
|
||||
"veuug",
|
||||
"vaac",
|
||||
"TRZccci",
|
||||
"vec4i",
|
||||
"TRZccch",
|
||||
"vec4h",
|
||||
"vTc4O8",
|
||||
"vem04i",
|
||||
"meBB4i",
|
||||
"vem04h",
|
||||
"meBB4h",
|
||||
"Mpp4",
|
||||
"OOe4u",
|
||||
"OOe4i",
|
||||
"veG4G",
|
||||
"vec4u",
|
||||
"11eHH4u",
|
||||
"vec4i",
|
||||
"11eHH4i",
|
||||
"veFFe6",
|
||||
"ve4",
|
||||
"vKii4l",
|
||||
"ec4u",
|
||||
"v994IIv",
|
||||
"vec4u",
|
||||
"vecu",
|
||||
"vechu",
|
||||
"vczllPu",
|
||||
};
|
||||
for (auto _ : state) {
|
||||
for (auto* str : kStrings) {
|
||||
|
|
|
@ -43,24 +43,43 @@ inline std::ostream& operator<<(std::ostream& out, Case c) {
|
|||
}
|
||||
|
||||
static constexpr Case kValidCases[] = {
|
||||
{"bool", Builtin::kBool}, {"f16", Builtin::kF16},
|
||||
{"f32", Builtin::kF32}, {"i32", Builtin::kI32},
|
||||
{"mat2x2f", Builtin::kMat2X2F}, {"mat2x2h", Builtin::kMat2X2H},
|
||||
{"mat2x3f", Builtin::kMat2X3F}, {"mat2x3h", Builtin::kMat2X3H},
|
||||
{"mat2x4f", Builtin::kMat2X4F}, {"mat2x4h", Builtin::kMat2X4H},
|
||||
{"mat3x2f", Builtin::kMat3X2F}, {"mat3x2h", Builtin::kMat3X2H},
|
||||
{"mat3x3f", Builtin::kMat3X3F}, {"mat3x3h", Builtin::kMat3X3H},
|
||||
{"mat3x4f", Builtin::kMat3X4F}, {"mat3x4h", Builtin::kMat3X4H},
|
||||
{"mat4x2f", Builtin::kMat4X2F}, {"mat4x2h", Builtin::kMat4X2H},
|
||||
{"mat4x3f", Builtin::kMat4X3F}, {"mat4x3h", Builtin::kMat4X3H},
|
||||
{"mat4x4f", Builtin::kMat4X4F}, {"mat4x4h", Builtin::kMat4X4H},
|
||||
{"sampler", Builtin::kSampler}, {"sampler_comparison", Builtin::kSamplerComparison},
|
||||
{"u32", Builtin::kU32}, {"vec2f", Builtin::kVec2F},
|
||||
{"vec2h", Builtin::kVec2H}, {"vec2i", Builtin::kVec2I},
|
||||
{"vec2u", Builtin::kVec2U}, {"vec3f", Builtin::kVec3F},
|
||||
{"vec3h", Builtin::kVec3H}, {"vec3i", Builtin::kVec3I},
|
||||
{"vec3u", Builtin::kVec3U}, {"vec4f", Builtin::kVec4F},
|
||||
{"vec4h", Builtin::kVec4H}, {"vec4i", Builtin::kVec4I},
|
||||
{"bool", Builtin::kBool},
|
||||
{"f16", Builtin::kF16},
|
||||
{"f32", Builtin::kF32},
|
||||
{"i32", Builtin::kI32},
|
||||
{"mat2x2f", Builtin::kMat2X2F},
|
||||
{"mat2x2h", Builtin::kMat2X2H},
|
||||
{"mat2x3f", Builtin::kMat2X3F},
|
||||
{"mat2x3h", Builtin::kMat2X3H},
|
||||
{"mat2x4f", Builtin::kMat2X4F},
|
||||
{"mat2x4h", Builtin::kMat2X4H},
|
||||
{"mat3x2f", Builtin::kMat3X2F},
|
||||
{"mat3x2h", Builtin::kMat3X2H},
|
||||
{"mat3x3f", Builtin::kMat3X3F},
|
||||
{"mat3x3h", Builtin::kMat3X3H},
|
||||
{"mat3x4f", Builtin::kMat3X4F},
|
||||
{"mat3x4h", Builtin::kMat3X4H},
|
||||
{"mat4x2f", Builtin::kMat4X2F},
|
||||
{"mat4x2h", Builtin::kMat4X2H},
|
||||
{"mat4x3f", Builtin::kMat4X3F},
|
||||
{"mat4x3h", Builtin::kMat4X3H},
|
||||
{"mat4x4f", Builtin::kMat4X4F},
|
||||
{"mat4x4h", Builtin::kMat4X4H},
|
||||
{"sampler", Builtin::kSampler},
|
||||
{"sampler_comparison", Builtin::kSamplerComparison},
|
||||
{"texture_external", Builtin::kTextureExternal},
|
||||
{"u32", Builtin::kU32},
|
||||
{"vec2f", Builtin::kVec2F},
|
||||
{"vec2h", Builtin::kVec2H},
|
||||
{"vec2i", Builtin::kVec2I},
|
||||
{"vec2u", Builtin::kVec2U},
|
||||
{"vec3f", Builtin::kVec3F},
|
||||
{"vec3h", Builtin::kVec3H},
|
||||
{"vec3i", Builtin::kVec3I},
|
||||
{"vec3u", Builtin::kVec3U},
|
||||
{"vec4f", Builtin::kVec4F},
|
||||
{"vec4h", Builtin::kVec4H},
|
||||
{"vec4i", Builtin::kVec4I},
|
||||
{"vec4u", Builtin::kVec4U},
|
||||
};
|
||||
|
||||
|
@ -137,45 +156,48 @@ static constexpr Case kInvalidCases[] = {
|
|||
{"sWWpleq_compari44on", Builtin::kUndefined},
|
||||
{"sampler_compaisoOO", Builtin::kUndefined},
|
||||
{"smpeoo_coYparison", Builtin::kUndefined},
|
||||
{"", Builtin::kUndefined},
|
||||
{"u3", Builtin::kUndefined},
|
||||
{"3w", Builtin::kUndefined},
|
||||
{"veff", Builtin::kUndefined},
|
||||
{"KKeq2f", Builtin::kUndefined},
|
||||
{"vFmm2f", Builtin::kUndefined},
|
||||
{"vech", Builtin::kUndefined},
|
||||
{"qc2h", Builtin::kUndefined},
|
||||
{"eture_eternal", Builtin::kUndefined},
|
||||
{"texture_exeFnal", Builtin::kUndefined},
|
||||
{"textureewternal", Builtin::kUndefined},
|
||||
{"Gf", Builtin::kUndefined},
|
||||
{"KK3q", Builtin::kUndefined},
|
||||
{"umm2", Builtin::kUndefined},
|
||||
{"vecf", Builtin::kUndefined},
|
||||
{"qc2f", Builtin::kUndefined},
|
||||
{"vecbb", Builtin::kUndefined},
|
||||
{"iic2", Builtin::kUndefined},
|
||||
{"vqOOi", Builtin::kUndefined},
|
||||
{"vevvTTi", Builtin::kUndefined},
|
||||
{"veFF2u", Builtin::kUndefined},
|
||||
{"vqOOh", Builtin::kUndefined},
|
||||
{"vevvTTh", Builtin::kUndefined},
|
||||
{"veFF2i", Builtin::kUndefined},
|
||||
{"00PfQ", Builtin::kUndefined},
|
||||
{"vec2P", Builtin::kUndefined},
|
||||
{"vec77s", Builtin::kUndefined},
|
||||
{"vecbbCf", Builtin::kUndefined},
|
||||
{"vecXXf", Builtin::kUndefined},
|
||||
{"vecbbCu", Builtin::kUndefined},
|
||||
{"vecXXu", Builtin::kUndefined},
|
||||
{"CCOOec3", Builtin::kUndefined},
|
||||
{"vs3u", Builtin::kUndefined},
|
||||
{"Xec3h", Builtin::kUndefined},
|
||||
{"ve3i", Builtin::kUndefined},
|
||||
{"Xec3f", Builtin::kUndefined},
|
||||
{"ve3h", Builtin::kUndefined},
|
||||
{"qq3", Builtin::kUndefined},
|
||||
{"vec322", Builtin::kUndefined},
|
||||
{"vezzXy", Builtin::kUndefined},
|
||||
{"ieVVP", Builtin::kUndefined},
|
||||
{"venCu", Builtin::kUndefined},
|
||||
{"vHc4Aq", Builtin::kUndefined},
|
||||
{"ve4f", Builtin::kUndefined},
|
||||
{"venCi", Builtin::kUndefined},
|
||||
{"vHc3Aq", Builtin::kUndefined},
|
||||
{"ve3u", Builtin::kUndefined},
|
||||
{"vefK", Builtin::kUndefined},
|
||||
{"vgg4", Builtin::kUndefined},
|
||||
{"vech", Builtin::kUndefined},
|
||||
{"4TNc4h", Builtin::kUndefined},
|
||||
{"vecf", Builtin::kUndefined},
|
||||
{"4TNc4f", Builtin::kUndefined},
|
||||
{"ppec7l", Builtin::kUndefined},
|
||||
{"zNe4i", Builtin::kUndefined},
|
||||
{"uXXb4i", Builtin::kUndefined},
|
||||
{"zNe4h", Builtin::kUndefined},
|
||||
{"uXXb4h", Builtin::kUndefined},
|
||||
{"vec4", Builtin::kUndefined},
|
||||
{"884K", Builtin::kUndefined},
|
||||
{"vq9u", Builtin::kUndefined},
|
||||
{"vq9i", Builtin::kUndefined},
|
||||
{"vec411", Builtin::kUndefined},
|
||||
{"22ciiu", Builtin::kUndefined},
|
||||
{"ec77u", Builtin::kUndefined},
|
||||
};
|
||||
|
||||
using BuiltinParseTest = testing::TestWithParam<Case>;
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "src/tint/ast/external_texture.h"
|
||||
#include "src/tint/ast/module.h"
|
||||
#include "src/tint/program.h"
|
||||
#include "src/tint/sem/variable.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "src/tint/ast/bool_literal_expression.h"
|
||||
#include "src/tint/ast/call_statement.h"
|
||||
#include "src/tint/ast/depth_texture.h"
|
||||
#include "src/tint/ast/external_texture.h"
|
||||
#include "src/tint/ast/float_literal_expression.h"
|
||||
#include "src/tint/ast/id_attribute.h"
|
||||
#include "src/tint/ast/internal_attribute.h"
|
||||
|
@ -452,10 +451,6 @@ bool GeneratorImpl::EmitType(std::ostream& out, const ast::Type* ty) {
|
|||
out << ">";
|
||||
return true;
|
||||
},
|
||||
[&](const ast::ExternalTexture*) {
|
||||
out << "texture_external";
|
||||
return true;
|
||||
},
|
||||
[&](const ast::Texture* texture) {
|
||||
out << "texture_";
|
||||
bool ok = Switch(
|
||||
|
|
Loading…
Reference in New Issue