From 34ac1afd9989f335e7d81da2dbaee72cf1d2ed05 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 26 Jan 2021 21:44:54 +0000 Subject: [PATCH] Remove old texture type support. This CL removes all of the old texture type names in favour of the new variants. Change-Id: Icb3c9ed8e39c8d7320fd6a6706b8029fcb3e5947 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38826 Auto-Submit: dan sinclair Reviewed-by: David Neto Commit-Queue: dan sinclair --- src/reader/wgsl/lexer.cc | 88 ------- src/reader/wgsl/lexer_test.cc | 44 ---- src/reader/wgsl/parser_impl.cc | 86 ------- src/reader/wgsl/parser_impl.h | 5 - src/reader/wgsl/parser_impl_error_msg_test.cc | 70 ------ .../parser_impl_sampled_texture_type_test.cc | 63 ----- .../parser_impl_storage_texture_type_test.cc | 207 --------------- .../parser_impl_texture_sampler_types_test.cc | 238 ------------------ src/reader/wgsl/parser_impl_type_decl_test.cc | 17 -- src/reader/wgsl/token.cc | 20 -- src/reader/wgsl/token.h | 60 ----- 11 files changed, 898 deletions(-) diff --git a/src/reader/wgsl/lexer.cc b/src/reader/wgsl/lexer.cc index f201d75d54..9a2200bbb7 100644 --- a/src/reader/wgsl/lexer.cc +++ b/src/reader/wgsl/lexer.cc @@ -677,40 +677,6 @@ Token Lexer::check_keyword(const Source& source, const std::string& str) { return {Token::Type::kTextureMultisampled2d, source, "texture_multisampled_2d"}; } - if (str == "texture_ro_1d") - return {Token::Type::kTextureStorageReadonly1d, source, "texture_ro_1d"}; - if (str == "texture_ro_1d_array") { - return {Token::Type::kTextureStorageReadonly1dArray, source, - "texture_ro_1d_array"}; - } - if (str == "texture_ro_2d") - return {Token::Type::kTextureStorageReadonly2d, source, "texture_ro_2d"}; - if (str == "texture_ro_2d_array") { - return {Token::Type::kTextureStorageReadonly2dArray, source, - "texture_ro_2d_array"}; - } - if (str == "texture_ro_3d") - return {Token::Type::kTextureStorageReadonly3d, source, "texture_ro_3d"}; - if (str == "texture_sampled_1d") - return {Token::Type::kTextureSampled1d, source, "texture_sampled_1d"}; - if (str == "texture_sampled_1d_array") { - return {Token::Type::kTextureSampled1dArray, source, - "texture_sampled_1d_array"}; - } - if (str == "texture_sampled_2d") - return {Token::Type::kTextureSampled2d, source, "texture_sampled_2d"}; - if (str == "texture_sampled_2d_array") { - return {Token::Type::kTextureSampled2dArray, source, - "texture_sampled_2d_array"}; - } - if (str == "texture_sampled_3d") - return {Token::Type::kTextureSampled3d, source, "texture_sampled_3d"}; - if (str == "texture_sampled_cube") - return {Token::Type::kTextureSampledCube, source, "texture_sampled_cube"}; - if (str == "texture_sampled_cube_array") { - return {Token::Type::kTextureSampledCubeArray, source, - "texture_sampled_cube_array"}; - } if (str == "texture_storage_1d") { return {Token::Type::kTextureStorage1d, source, "texture_storage_1d"}; } @@ -728,60 +694,6 @@ Token Lexer::check_keyword(const Source& source, const std::string& str) { if (str == "texture_storage_3d") { return {Token::Type::kTextureStorage3d, source, "texture_storage_3d"}; } - if (str == "texture_storage_wo_1d") { - return {Token::Type::kTextureStorageWriteonly1d, source, - "texture_storage_wo_1d"}; - } - if (str == "texture_storage_wo_1d_array") { - return {Token::Type::kTextureStorageWriteonly1dArray, source, - "texture_storage_wo_1d_array"}; - } - if (str == "texture_storage_wo_2d") { - return {Token::Type::kTextureStorageWriteonly2d, source, - "texture_storage_wo_2d"}; - } - if (str == "texture_storage_wo_2d_array") { - return {Token::Type::kTextureStorageWriteonly2dArray, source, - "texture_storage_wo_2d_array"}; - } - if (str == "texture_storage_wo_3d") { - return {Token::Type::kTextureStorageWriteonly3d, source, - "texture_storage_wo_3d"}; - } - if (str == "texture_storage_ro_1d") { - return {Token::Type::kTextureStorageReadonly1d, source, - "texture_storage_ro_1d"}; - } - if (str == "texture_storage_ro_1d_array") { - return {Token::Type::kTextureStorageReadonly1dArray, source, - "texture_storage_ro_1d_array"}; - } - if (str == "texture_storage_ro_2d") { - return {Token::Type::kTextureStorageReadonly2d, source, - "texture_storage_ro_2d"}; - } - if (str == "texture_storage_ro_2d_array") { - return {Token::Type::kTextureStorageReadonly2dArray, source, - "texture_storage_ro_2d_array"}; - } - if (str == "texture_storage_ro_3d") { - return {Token::Type::kTextureStorageReadonly3d, source, - "texture_storage_ro_3d"}; - } - if (str == "texture_wo_1d") - return {Token::Type::kTextureStorageWriteonly1d, source, "texture_wo_1d"}; - if (str == "texture_wo_1d_array") { - return {Token::Type::kTextureStorageWriteonly1dArray, source, - "texture_wo_1d_array"}; - } - if (str == "texture_wo_2d") - return {Token::Type::kTextureStorageWriteonly2d, source, "texture_wo_2d"}; - if (str == "texture_wo_2d_array") { - return {Token::Type::kTextureStorageWriteonly2dArray, source, - "texture_wo_2d_array"}; - } - if (str == "texture_wo_3d") - return {Token::Type::kTextureStorageWriteonly3d, source, "texture_wo_3d"}; if (str == "true") return {Token::Type::kTrue, source, "true"}; if (str == "type") diff --git a/src/reader/wgsl/lexer_test.cc b/src/reader/wgsl/lexer_test.cc index cdcdf34ca5..8af9284d32 100644 --- a/src/reader/wgsl/lexer_test.cc +++ b/src/reader/wgsl/lexer_test.cc @@ -558,13 +558,6 @@ INSTANTIATE_TEST_SUITE_P( Token::Type::kTextureDepthCubeArray}, TokenData{"texture_multisampled_2d", Token::Type::kTextureMultisampled2d}, - TokenData{"texture_ro_1d", Token::Type::kTextureStorageReadonly1d}, - TokenData{"texture_ro_1d_array", - Token::Type::kTextureStorageReadonly1dArray}, - TokenData{"texture_ro_2d", Token::Type::kTextureStorageReadonly2d}, - TokenData{"texture_ro_2d_array", - Token::Type::kTextureStorageReadonly2dArray}, - TokenData{"texture_ro_3d", Token::Type::kTextureStorageReadonly3d}, TokenData{"texture_storage_1d", Token::Type::kTextureStorage1d}, TokenData{"texture_storage_1d_array", Token::Type::kTextureStorage1dArray}, @@ -572,43 +565,6 @@ INSTANTIATE_TEST_SUITE_P( TokenData{"texture_storage_2d_array", Token::Type::kTextureStorage2dArray}, TokenData{"texture_storage_3d", Token::Type::kTextureStorage3d}, - TokenData{"texture_storage_ro_1d", - Token::Type::kTextureStorageReadonly1d}, - TokenData{"texture_storage_ro_1d_array", - Token::Type::kTextureStorageReadonly1dArray}, - TokenData{"texture_storage_ro_2d", - Token::Type::kTextureStorageReadonly2d}, - TokenData{"texture_storage_ro_2d_array", - Token::Type::kTextureStorageReadonly2dArray}, - TokenData{"texture_storage_ro_3d", - Token::Type::kTextureStorageReadonly3d}, - TokenData{"texture_storage_wo_1d", - Token::Type::kTextureStorageWriteonly1d}, - TokenData{"texture_storage_wo_1d_array", - Token::Type::kTextureStorageWriteonly1dArray}, - TokenData{"texture_storage_wo_2d", - Token::Type::kTextureStorageWriteonly2d}, - TokenData{"texture_storage_wo_2d_array", - Token::Type::kTextureStorageWriteonly2dArray}, - TokenData{"texture_storage_wo_3d", - Token::Type::kTextureStorageWriteonly3d}, - TokenData{"texture_sampled_1d", Token::Type::kTextureSampled1d}, - TokenData{"texture_sampled_1d_array", - Token::Type::kTextureSampled1dArray}, - TokenData{"texture_sampled_2d", Token::Type::kTextureSampled2d}, - TokenData{"texture_sampled_2d_array", - Token::Type::kTextureSampled2dArray}, - TokenData{"texture_sampled_3d", Token::Type::kTextureSampled3d}, - TokenData{"texture_sampled_cube", Token::Type::kTextureSampledCube}, - TokenData{"texture_sampled_cube_array", - Token::Type::kTextureSampledCubeArray}, - TokenData{"texture_wo_1d", Token::Type::kTextureStorageWriteonly1d}, - TokenData{"texture_wo_1d_array", - Token::Type::kTextureStorageWriteonly1dArray}, - TokenData{"texture_wo_2d", Token::Type::kTextureStorageWriteonly2d}, - TokenData{"texture_wo_2d_array", - Token::Type::kTextureStorageWriteonly2dArray}, - TokenData{"texture_wo_3d", Token::Type::kTextureStorageWriteonly3d}, TokenData{"true", Token::Type::kTrue}, TokenData{"type", Token::Type::kType}, TokenData{"u32", Token::Type::kU32}, diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc index dcf8794b37..d573da35ae 100644 --- a/src/reader/wgsl/parser_impl.cc +++ b/src/reader/wgsl/parser_impl.cc @@ -537,22 +537,6 @@ Maybe ParserImpl::texture_sampler_types() { return builder_.create(storage.value, format.value); } - // DEPRECATED - auto ac_storage = storage_texture_type_access_control(); - if (ac_storage.matched) { - const char* use = "storage texture type"; - - auto format = - expect_lt_gt_block(use, [&] { return expect_image_storage_type(use); }); - - if (format.errored) - return Failure::kErrored; - - return builder_.create( - ac_storage->second, - builder_.create(ac_storage->first, format.value)); - } - return Failure::kNoMatch; } @@ -633,76 +617,6 @@ Maybe ParserImpl::storage_texture_type() { return Failure::kNoMatch; } -// DEPRECATED -// storage_texture_type -// | TEXTURE_RO_1D -// | TEXTURE_RO_1D_ARRAY -// | TEXTURE_RO_2D -// | TEXTURE_RO_2D_ARRAY -// | TEXTURE_RO_3D -// | TEXTURE_WO_1D -// | TEXTURE_WO_1D_ARRAY -// | TEXTURE_WO_2D -// | TEXTURE_WO_2D_ARRAY -// | TEXTURE_WO_3D -// | TEXTURE_STORAGE_RO_1D -// | TEXTURE_STORAGE_RO_1D_ARRAY -// | TEXTURE_STORAGE_RO_2D -// | TEXTURE_STORAGE_RO_2D_ARRAY -// | TEXTURE_STORAGE_RO_3D -// | TEXTURE_STORAGE_WO_1D -// | TEXTURE_STORAGE_WO_1D_ARRAY -// | TEXTURE_STORAGE_WO_2D -// | TEXTURE_STORAGE_WO_2D_ARRAY -// | TEXTURE_STORAGE_WO_3D -Maybe> -ParserImpl::storage_texture_type_access_control() { - using Ret = std::pair; - if (match(Token::Type::kTextureStorageReadonly1d)) { - return Ret{type::TextureDimension::k1d, ast::AccessControl::kReadOnly}; - } - - if (match(Token::Type::kTextureStorageReadonly1dArray)) { - return Ret{type::TextureDimension::k1dArray, ast::AccessControl::kReadOnly}; - } - - if (match(Token::Type::kTextureStorageReadonly2d)) { - return Ret{type::TextureDimension::k2d, ast::AccessControl::kReadOnly}; - } - - if (match(Token::Type::kTextureStorageReadonly2dArray)) { - return Ret{type::TextureDimension::k2dArray, ast::AccessControl::kReadOnly}; - } - - if (match(Token::Type::kTextureStorageReadonly3d)) { - return Ret{type::TextureDimension::k3d, ast::AccessControl::kReadOnly}; - } - - if (match(Token::Type::kTextureStorageWriteonly1d)) { - return Ret{type::TextureDimension::k1d, ast::AccessControl::kWriteOnly}; - } - - if (match(Token::Type::kTextureStorageWriteonly1dArray)) { - return Ret{type::TextureDimension::k1dArray, - ast::AccessControl::kWriteOnly}; - } - - if (match(Token::Type::kTextureStorageWriteonly2d)) { - return Ret{type::TextureDimension::k2d, ast::AccessControl::kWriteOnly}; - } - - if (match(Token::Type::kTextureStorageWriteonly2dArray)) { - return Ret{type::TextureDimension::k2dArray, - ast::AccessControl::kWriteOnly}; - } - - if (match(Token::Type::kTextureStorageWriteonly3d)) { - return Ret{type::TextureDimension::k3d, ast::AccessControl::kWriteOnly}; - } - - return Failure::kNoMatch; -} - // depth_texture_type // : TEXTURE_DEPTH_2D // | TEXTURE_DEPTH_2D_ARRAY diff --git a/src/reader/wgsl/parser_impl.h b/src/reader/wgsl/parser_impl.h index 943b5e0998..56229b79d9 100644 --- a/src/reader/wgsl/parser_impl.h +++ b/src/reader/wgsl/parser_impl.h @@ -430,11 +430,6 @@ class ParserImpl { /// @returns returns the storage texture dimension. /// Returns kNone if none matched. Maybe storage_texture_type(); - /// Parses a deprecated `storage_texture_type` grammar element - /// @returns returns the storage texture dimension and the storage access. - /// Returns kNone and kRead if none matched. - Maybe> - storage_texture_type_access_control(); /// Parses a `depth_texture_type` grammar element /// @returns the parsed Type or nullptr if none matched. Maybe depth_texture_type(); diff --git a/src/reader/wgsl/parser_impl_error_msg_test.cc b/src/reader/wgsl/parser_impl_error_msg_test.cc index ae6890c83c..24ac9f3a95 100644 --- a/src/reader/wgsl/parser_impl_error_msg_test.cc +++ b/src/reader/wgsl/parser_impl_error_msg_test.cc @@ -566,27 +566,6 @@ TEST_F(ParserImplErrorTest, GlobalDeclConstExprMissingRParen) { " ^\n"); } -TEST_F(ParserImplErrorTest, GlobalDeclSampledTextureMissingLessThan_Old) { - EXPECT("var x : texture_sampled_1d;", - "test.wgsl:1:27 error: expected '<' for sampled texture type\n" - "var x : texture_sampled_1d;\n" - " ^\n"); -} - -TEST_F(ParserImplErrorTest, GlobalDeclSampledTextureMissingGreaterThan_Old) { - EXPECT("var x : texture_sampled_1d' for sampled texture type\n" - "var x : texture_sampled_1d;", - "test.wgsl:1:28 error: invalid type for sampled texture type\n" - "var x : texture_sampled_1d<1>;\n" - " ^\n"); -} - TEST_F(ParserImplErrorTest, GlobalDeclSampledTextureMissingLessThan) { EXPECT("var x : texture_1d;", "test.wgsl:1:19 error: expected '<' for sampled texture type\n" @@ -629,27 +608,6 @@ TEST_F(ParserImplErrorTest, GlobalDeclMultisampledTextureInvalidSubtype) { " ^\n"); } -TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingLessThan_Old) { - EXPECT("var x : texture_ro_2d;", - "test.wgsl:1:22 error: expected '<' for storage texture type\n" - "var x : texture_ro_2d;\n" - " ^\n"); -} - -TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingGreaterThan_Old) { - EXPECT("var x : texture_ro_2d' for storage texture type\n" - "var x : texture_ro_2d;", - "test.wgsl:1:23 error: invalid format for storage texture type\n" - "var x : texture_ro_2d<1>;\n" - " ^\n"); -} - TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingLessThan) { EXPECT("var x : [[access(read)]] texture_storage_2d;", "test.wgsl:1:44 error: expected '<' for storage texture type\n" @@ -678,34 +636,6 @@ TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingInvalidSubtype) { " ^\n"); } -TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingLessThan_old) { - EXPECT("var x : texture_storage_ro_2d;", - "test.wgsl:1:30 error: expected '<' for storage texture type\n" - "var x : texture_storage_ro_2d;\n" - " ^\n"); -} - -TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingGreaterThan_old) { - EXPECT("var x : texture_storage_ro_2d' for storage texture type\n" - "var x : texture_storage_ro_2d;", - "test.wgsl:1:31 error: invalid format for storage texture type\n" - "var x : texture_storage_ro_2d<>;\n" - " ^\n"); -} - -TEST_F(ParserImplErrorTest, GlobalDeclStorageTextureMissingInvalidSubtype_old) { - EXPECT("var x : texture_storage_ro_2d<1>;", - "test.wgsl:1:31 error: invalid format for storage texture type\n" - "var x : texture_storage_ro_2d<1>;\n" - " ^\n"); -} - TEST_F(ParserImplErrorTest, GlobalDeclStructDecoMissingStruct) { EXPECT("[[block]];", "test.wgsl:1:10 error: expected declaration after decorations\n" diff --git a/src/reader/wgsl/parser_impl_sampled_texture_type_test.cc b/src/reader/wgsl/parser_impl_sampled_texture_type_test.cc index fc553e3b8f..6df54081d9 100644 --- a/src/reader/wgsl/parser_impl_sampled_texture_type_test.cc +++ b/src/reader/wgsl/parser_impl_sampled_texture_type_test.cc @@ -30,69 +30,6 @@ TEST_F(ParserImplTest, SampledTextureType_Invalid) { EXPECT_FALSE(p->has_error()); } -TEST_F(ParserImplTest, SampledTextureType_1d_Old) { - auto p = parser("texture_sampled_1d"); - auto t = p->sampled_texture_type(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(t.value, type::TextureDimension::k1d); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, SampledTextureType_1dArray_Old) { - auto p = parser("texture_sampled_1d_array"); - auto t = p->sampled_texture_type(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(t.value, type::TextureDimension::k1dArray); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, SampledTextureType_2d_Old) { - auto p = parser("texture_sampled_2d"); - auto t = p->sampled_texture_type(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(t.value, type::TextureDimension::k2d); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, SampledTextureType_2dArray_Old) { - auto p = parser("texture_sampled_2d_array"); - auto t = p->sampled_texture_type(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(t.value, type::TextureDimension::k2dArray); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, SampledTextureType_3d_Old) { - auto p = parser("texture_sampled_3d"); - auto t = p->sampled_texture_type(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(t.value, type::TextureDimension::k3d); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, SampledTextureType_Cube_Old) { - auto p = parser("texture_sampled_cube"); - auto t = p->sampled_texture_type(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(t.value, type::TextureDimension::kCube); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, SampledTextureType_kCubeArray_Old) { - auto p = parser("texture_sampled_cube_array"); - auto t = p->sampled_texture_type(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(t.value, type::TextureDimension::kCubeArray); - EXPECT_FALSE(p->has_error()); -} - TEST_F(ParserImplTest, SampledTextureType_1d) { auto p = parser("texture_1d"); auto t = p->sampled_texture_type(); diff --git a/src/reader/wgsl/parser_impl_storage_texture_type_test.cc b/src/reader/wgsl/parser_impl_storage_texture_type_test.cc index d145af8455..999f6a143f 100644 --- a/src/reader/wgsl/parser_impl_storage_texture_type_test.cc +++ b/src/reader/wgsl/parser_impl_storage_texture_type_test.cc @@ -75,213 +75,6 @@ TEST_F(ParserImplTest, StorageTextureType_3d) { EXPECT_FALSE(p->has_error()); } -TEST_F(ParserImplTest, StorageTextureType_Invalid_old) { - auto p = parser("abc"); - auto t = p->storage_texture_type_access_control(); - EXPECT_FALSE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Readonly1d_Old) { - auto p = parser("texture_ro_1d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k1d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Readonly1dArray_Old) { - auto p = parser("texture_ro_1d_array"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k1dArray); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Readonly2d_Old) { - auto p = parser("texture_ro_2d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k2d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Readonly2dArray_Old) { - auto p = parser("texture_ro_2d_array"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k2dArray); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Readonly3d_Old) { - auto p = parser("texture_ro_3d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k3d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Writeonly1d_Old) { - auto p = parser("texture_wo_1d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k1d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Writeonly1dArray_Old) { - auto p = parser("texture_wo_1d_array"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k1dArray); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Writeonly2d_Old) { - auto p = parser("texture_wo_2d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k2d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Writeonly2dArray_Old) { - auto p = parser("texture_wo_2d_array"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k2dArray); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_Writeonly3d_Old) { - auto p = parser("texture_wo_3d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k3d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_ro_1d) { - auto p = parser("texture_storage_ro_1d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k1d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_ro_1dArray) { - auto p = parser("texture_storage_ro_1d_array"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k1dArray); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_ro_2d) { - auto p = parser("texture_storage_ro_2d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k2d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_ro_2dArray) { - auto p = parser("texture_storage_ro_2d_array"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k2dArray); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_ro_3d) { - auto p = parser("texture_storage_ro_3d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k3d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kReadOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_wo_1d) { - auto p = parser("texture_storage_wo_1d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k1d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_wo_1dArray) { - auto p = parser("texture_storage_wo_1d_array"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k1dArray); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_wo_2d) { - auto p = parser("texture_storage_wo_2d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k2d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_wo_2dArray) { - auto p = parser("texture_storage_wo_2d_array"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k2dArray); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} - -TEST_F(ParserImplTest, StorageTextureType_wo_3d) { - auto p = parser("texture_storage_wo_3d"); - auto t = p->storage_texture_type_access_control(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(std::get<0>(t.value), type::TextureDimension::k3d); - EXPECT_EQ(std::get<1>(t.value), ast::AccessControl::kWriteOnly); - EXPECT_FALSE(p->has_error()); -} } // namespace } // namespace wgsl } // namespace reader diff --git a/src/reader/wgsl/parser_impl_texture_sampler_types_test.cc b/src/reader/wgsl/parser_impl_texture_sampler_types_test.cc index df3f0b6ac6..0023a1ca7a 100644 --- a/src/reader/wgsl/parser_impl_texture_sampler_types_test.cc +++ b/src/reader/wgsl/parser_impl_texture_sampler_types_test.cc @@ -72,86 +72,6 @@ TEST_F(ParserImplTest, TextureSamplerTypes_DepthTexture) { EXPECT_EQ(t->As()->dim(), type::TextureDimension::k2d); } -TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_F32_Old) { - auto p = parser("texture_sampled_1d"); - auto t = p->texture_sampler_types(); - ASSERT_FALSE(p->has_error()) << p->error(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - ASSERT_NE(t.value, nullptr); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->As()->type()->Is()); - EXPECT_EQ(t->As()->dim(), type::TextureDimension::k1d); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_I32_Old) { - auto p = parser("texture_sampled_2d"); - auto t = p->texture_sampler_types(); - ASSERT_FALSE(p->has_error()) << p->error(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - ASSERT_NE(t.value, nullptr); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->As()->type()->Is()); - EXPECT_EQ(t->As()->dim(), type::TextureDimension::k2d); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_U32_Old) { - auto p = parser("texture_sampled_3d"); - auto t = p->texture_sampler_types(); - ASSERT_FALSE(p->has_error()) << p->error(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - ASSERT_NE(t.value, nullptr); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->As()->type()->Is()); - EXPECT_EQ(t->As()->dim(), type::TextureDimension::k3d); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_Invalid_Old) { - auto p = parser("texture_sampled_1d"); - auto t = p->texture_sampler_types(); - ASSERT_TRUE(p->has_error()); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:20: unknown constructed type 'abc'"); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_MissingType_Old) { - auto p = parser("texture_sampled_1d<>"); - auto t = p->texture_sampler_types(); - ASSERT_TRUE(p->has_error()); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:20: invalid type for sampled texture type"); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_MissingLessThan_Old) { - auto p = parser("texture_sampled_1d"); - auto t = p->texture_sampler_types(); - ASSERT_TRUE(p->has_error()); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:19: expected '<' for sampled texture type"); -} - -TEST_F(ParserImplTest, - TextureSamplerTypes_SampledTexture_MissingGreaterThan_Old) { - auto p = parser("texture_sampled_1dtexture_sampler_types(); - ASSERT_TRUE(p->has_error()); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:23: expected '>' for sampled texture type"); -} - TEST_F(ParserImplTest, TextureSamplerTypes_SampledTexture_F32) { auto p = parser("texture_1d"); auto t = p->texture_sampler_types(); @@ -284,164 +204,6 @@ TEST_F(ParserImplTest, EXPECT_EQ(p->error(), "1:28: expected '>' for multisampled texture type"); } -TEST_F(ParserImplTest, - TextureSamplerTypes_StorageTexture_Readonly1dR8Unorm_Old) { - auto p = parser("texture_ro_1d"); - auto ac = p->texture_sampler_types(); - ASSERT_FALSE(p->has_error()) << p->error(); - EXPECT_TRUE(ac.matched); - EXPECT_FALSE(ac.errored); - ASSERT_NE(ac.value, nullptr); - - ASSERT_TRUE(ac->Is()); - EXPECT_EQ(ac->As()->access_control(), - ast::AccessControl::kReadOnly); - - auto* t = ac->As()->type(); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->Is()); - EXPECT_EQ(t->As()->image_format(), - type::ImageFormat::kR8Unorm); - EXPECT_EQ(t->As()->dim(), type::TextureDimension::k1d); -} - -TEST_F(ParserImplTest, - TextureSamplerTypes_StorageTexture_Writeonly2dR16Float_Old) { - auto p = parser("texture_wo_2d"); - auto ac = p->texture_sampler_types(); - ASSERT_FALSE(p->has_error()) << p->error(); - EXPECT_TRUE(ac.matched); - EXPECT_FALSE(ac.errored); - ASSERT_NE(ac.value, nullptr); - - ASSERT_TRUE(ac->Is()); - EXPECT_EQ(ac->As()->access_control(), - ast::AccessControl::kWriteOnly); - - auto* t = ac->As()->type(); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->Is()); - EXPECT_EQ(t->As()->image_format(), - type::ImageFormat::kR16Float); - EXPECT_EQ(t->As()->dim(), type::TextureDimension::k2d); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_InvalidType_Old) { - auto p = parser("texture_ro_1d"); - auto t = p->texture_sampler_types(); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:15: invalid format for storage texture type"); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingType_Old) { - auto p = parser("texture_wo_1d<>"); - auto t = p->texture_sampler_types(); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:15: invalid format for storage texture type"); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingLessThan_Old) { - auto p = parser("texture_ro_1d"); - auto t = p->texture_sampler_types(); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:14: expected '<' for storage texture type"); -} - -TEST_F(ParserImplTest, - TextureSamplerTypes_StorageTexture_MissingGreaterThan_Old) { - auto p = parser("texture_wo_1dtexture_sampler_types(); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:22: expected '>' for storage texture type"); -} - -TEST_F(ParserImplTest, - TextureSamplerTypes_StorageTexture_Readonly1dR8Unorm_old) { - auto p = parser("texture_storage_ro_1d"); - auto ac = p->texture_sampler_types(); - ASSERT_FALSE(p->has_error()) << p->error(); - EXPECT_TRUE(ac.matched); - EXPECT_FALSE(ac.errored); - ASSERT_NE(ac.value, nullptr); - - ASSERT_TRUE(ac->Is()); - EXPECT_EQ(ac->As()->access_control(), - ast::AccessControl::kReadOnly); - - auto* t = ac->As()->type(); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->Is()); - EXPECT_EQ(t->As()->image_format(), - type::ImageFormat::kR8Unorm); - EXPECT_EQ(t->As()->dim(), type::TextureDimension::k1d); -} - -TEST_F(ParserImplTest, - TextureSamplerTypes_StorageTexture_Writeonly2dR16Float_old) { - auto p = parser("texture_storage_wo_2d"); - auto ac = p->texture_sampler_types(); - ASSERT_FALSE(p->has_error()) << p->error(); - EXPECT_TRUE(ac.matched); - EXPECT_FALSE(ac.errored); - ASSERT_NE(ac.value, nullptr); - - ASSERT_TRUE(ac->Is()); - EXPECT_EQ(ac->As()->access_control(), - ast::AccessControl::kWriteOnly); - - auto* t = ac->As()->type(); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->Is()); - EXPECT_EQ(t->As()->image_format(), - type::ImageFormat::kR16Float); - EXPECT_EQ(t->As()->dim(), type::TextureDimension::k2d); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_InvalidType_old) { - auto p = parser("texture_storage_ro_1d"); - auto t = p->texture_sampler_types(); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:23: invalid format for storage texture type"); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingType_old) { - auto p = parser("texture_storage_ro_1d<>"); - auto t = p->texture_sampler_types(); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:23: invalid format for storage texture type"); -} - -TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_MissingLessThan_old) { - auto p = parser("texture_storage_ro_1d"); - auto t = p->texture_sampler_types(); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:22: expected '<' for storage texture type"); -} - -TEST_F(ParserImplTest, - TextureSamplerTypes_StorageTexture_MissingGreaterThan_old) { - auto p = parser("texture_storage_ro_1dtexture_sampler_types(); - EXPECT_EQ(t.value, nullptr); - EXPECT_FALSE(t.matched); - EXPECT_TRUE(t.errored); - EXPECT_EQ(p->error(), "1:30: expected '>' for storage texture type"); -} - TEST_F(ParserImplTest, TextureSamplerTypes_StorageTexture_Readonly1dR8Unorm) { auto p = parser("texture_storage_1d"); auto t = p->texture_sampler_types(); diff --git a/src/reader/wgsl/parser_impl_type_decl_test.cc b/src/reader/wgsl/parser_impl_type_decl_test.cc index 78cf5c1ed9..6771de3df7 100644 --- a/src/reader/wgsl/parser_impl_type_decl_test.cc +++ b/src/reader/wgsl/parser_impl_type_decl_test.cc @@ -751,23 +751,6 @@ TEST_F(ParserImplTest, TypeDecl_Sampler) { ASSERT_FALSE(t->As()->IsComparison()); } -TEST_F(ParserImplTest, TypeDecl_Texture_Old) { - auto p = parser("texture_sampled_cube"); - - auto& builder = p->builder(); - auto* type = builder.create( - type::TextureDimension::kCube, ty.f32()); - - auto t = p->type_decl(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - ASSERT_NE(t.value, nullptr) << p->error(); - EXPECT_EQ(t.value, type); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->Is()); - ASSERT_TRUE(t->As()->type()->Is()); -} - TEST_F(ParserImplTest, TypeDecl_Texture) { auto p = parser("texture_cube"); diff --git a/src/reader/wgsl/token.cc b/src/reader/wgsl/token.cc index 50ff0d54b2..579ff07e3a 100644 --- a/src/reader/wgsl/token.cc +++ b/src/reader/wgsl/token.cc @@ -267,16 +267,6 @@ std::string Token::TypeToName(Type type) { return "texture_depth_cube_array"; case Token::Type::kTextureMultisampled2d: return "texture_multisampled_2d"; - case Token::Type::kTextureStorageReadonly1d: - return "texture_storage_ro_1d"; - case Token::Type::kTextureStorageReadonly1dArray: - return "texture_storage_ro_1d_array"; - case Token::Type::kTextureStorageReadonly2d: - return "texture_storage_ro_2d"; - case Token::Type::kTextureStorageReadonly2dArray: - return "texture_storage_ro_2d_array"; - case Token::Type::kTextureStorageReadonly3d: - return "texture_storage_ro_3d"; case Token::Type::kTextureSampled1d: return "texture_1d"; case Token::Type::kTextureSampled1dArray: @@ -301,16 +291,6 @@ std::string Token::TypeToName(Type type) { return "texture_storage_2d_array"; case Token::Type::kTextureStorage3d: return "texture_storage_3d"; - case Token::Type::kTextureStorageWriteonly1d: - return "texture_storage_wo_1d"; - case Token::Type::kTextureStorageWriteonly1dArray: - return "texture_storage_wo_1d_array"; - case Token::Type::kTextureStorageWriteonly2d: - return "texture_storage_wo_2d"; - case Token::Type::kTextureStorageWriteonly2dArray: - return "texture_storage_wo_2d_array"; - case Token::Type::kTextureStorageWriteonly3d: - return "texture_storage_wo_3d"; case Token::Type::kTrue: return "true"; case Token::Type::kType: diff --git a/src/reader/wgsl/token.h b/src/reader/wgsl/token.h index 79e04cedaa..fdf3b2ed0d 100644 --- a/src/reader/wgsl/token.h +++ b/src/reader/wgsl/token.h @@ -278,16 +278,6 @@ class Token { kTextureDepthCubeArray, /// A 'texture_multisampled_2d' kTextureMultisampled2d, - /// A 'texture_storage_ro_1d' - kTextureStorageReadonly1d, - /// A 'texture_storage_ro_2d_array' - kTextureStorageReadonly1dArray, - /// A 'texture_storage_ro_2d' - kTextureStorageReadonly2d, - /// A 'texture_storage_ro_2d_array' - kTextureStorageReadonly2dArray, - /// A 'texture_storage_ro_3d' - kTextureStorageReadonly3d, /// A 'texture_1d' kTextureSampled1d, /// A 'texture_1d_array' @@ -312,16 +302,6 @@ class Token { kTextureStorage2dArray, /// A 'texture_storage_3d' kTextureStorage3d, - /// A 'texture_wo_1d' - kTextureStorageWriteonly1d, - /// A 'texture_wo_2d_array' - kTextureStorageWriteonly1dArray, - /// A 'texture_wo_2d' - kTextureStorageWriteonly2d, - /// A 'texture_wo_2d_array' - kTextureStorageWriteonly2dArray, - /// A 'texture_wo_3d' - kTextureStorageWriteonly3d, /// A 'true' kTrue, /// A 'type' @@ -665,26 +645,6 @@ class Token { } /// @returns true if token is a 'texture_storage_3d' bool IsTextureStorage3d() const { return type_ == Type::kTextureStorage3d; } - /// @returns true if token is a 'texture_storage_ro_1d' - bool IsTextureStorageReadonly1d() const { - return type_ == Type::kTextureStorageReadonly1d; - } - /// @returns true if token is a 'texture_storage_ro_1d_array' - bool IsTextureStorageReadonly1dArray() const { - return type_ == Type::kTextureStorageReadonly1dArray; - } - /// @returns true if token is a 'texture_storage_ro_2d' - bool IsTextureStorageReadonly2d() const { - return type_ == Type::kTextureStorageReadonly2d; - } - /// @returns true if token is a 'texture_storage_ro_2d_array' - bool IsTextureStorageReadonly2dArray() const { - return type_ == Type::kTextureStorageReadonly2dArray; - } - /// @returns true if token is a 'texture_storage_ro_3d' - bool IsTextureStorageReadonly3d() const { - return type_ == Type::kTextureStorageReadonly3d; - } /// @returns true if token is a 'texture_1d' bool IsTextureSampled1d() const { return type_ == Type::kTextureSampled1d; } /// @returns true if token is a 'texture_1d_array' @@ -707,26 +667,6 @@ class Token { bool IsTextureSampledCubeArray() const { return type_ == Type::kTextureSampledCubeArray; } - /// @returns true if token is a 'texture_storage_wo_1d' - bool IsTextureStorageWriteonly1d() const { - return type_ == Type::kTextureStorageWriteonly1d; - } - /// @returns true if token is a 'texture_storage_wo_1d_array' - bool IsTextureStorageWriteonly1dArray() const { - return type_ == Type::kTextureStorageWriteonly1dArray; - } - /// @returns true if token is a 'texture_storage_wo_2d' - bool IsTextureStorageWriteonly2d() const { - return type_ == Type::kTextureStorageWriteonly2d; - } - /// @returns true if token is a 'texture_storage_wo_2d_array' - bool IsTextureStorageWriteonly2dArray() const { - return type_ == Type::kTextureStorageWriteonly2dArray; - } - /// @returns true if token is a 'texture_storage_wo_3d' - bool IsTextureStorageWriteonly3d() const { - return type_ == Type::kTextureStorageWriteonly3d; - } /// @returns true if token is a 'true' bool IsTrue() const { return type_ == Type::kTrue; } /// @returns true if token is a 'type'