diff --git a/src/ast/storage_class.cc b/src/ast/storage_class.cc index ca15be5097..9cbb4e0ec8 100644 --- a/src/ast/storage_class.cc +++ b/src/ast/storage_class.cc @@ -35,8 +35,6 @@ const char* ToString(StorageClass sc) { return "uniform_constant"; case StorageClass::kStorage: return "storage"; - case StorageClass::kImage: - return "image"; case StorageClass::kPrivate: return "private"; case StorageClass::kFunction: diff --git a/src/ast/storage_class.h b/src/ast/storage_class.h index ccfeda2502..e3009d3e86 100644 --- a/src/ast/storage_class.h +++ b/src/ast/storage_class.h @@ -30,7 +30,6 @@ enum class StorageClass { kWorkgroup, kUniformConstant, kStorage, - kImage, kPrivate, kFunction }; diff --git a/src/reader/spirv/enum_converter.cc b/src/reader/spirv/enum_converter.cc index 843076e1ed..7f9961e71d 100644 --- a/src/reader/spirv/enum_converter.cc +++ b/src/reader/spirv/enum_converter.cc @@ -52,8 +52,6 @@ ast::StorageClass EnumConverter::ToStorageClass(const SpvStorageClass sc) { return ast::StorageClass::kNone; case SpvStorageClassStorageBuffer: return ast::StorageClass::kStorage; - case SpvStorageClassImage: - return ast::StorageClass::kImage; case SpvStorageClassPrivate: return ast::StorageClass::kPrivate; case SpvStorageClassFunction: diff --git a/src/reader/spirv/enum_converter_test.cc b/src/reader/spirv/enum_converter_test.cc index 4c9cf5c856..d80f249a26 100644 --- a/src/reader/spirv/enum_converter_test.cc +++ b/src/reader/spirv/enum_converter_test.cc @@ -134,23 +134,22 @@ TEST_P(SpvStorageClassTest, Samples) { INSTANTIATE_TEST_SUITE_P( EnumConverterGood, SpvStorageClassTest, - testing::Values( - StorageClassCase{SpvStorageClassInput, true, ast::StorageClass::kInput}, - StorageClassCase{SpvStorageClassOutput, true, - ast::StorageClass::kOutput}, - StorageClassCase{SpvStorageClassUniform, true, - ast::StorageClass::kUniform}, - StorageClassCase{SpvStorageClassWorkgroup, true, - ast::StorageClass::kWorkgroup}, - StorageClassCase{SpvStorageClassUniformConstant, true, - ast::StorageClass::kNone}, - StorageClassCase{SpvStorageClassStorageBuffer, true, - ast::StorageClass::kStorage}, - StorageClassCase{SpvStorageClassImage, true, ast::StorageClass::kImage}, - StorageClassCase{SpvStorageClassPrivate, true, - ast::StorageClass::kPrivate}, - StorageClassCase{SpvStorageClassFunction, true, - ast::StorageClass::kFunction})); + testing::Values(StorageClassCase{SpvStorageClassInput, true, + ast::StorageClass::kInput}, + StorageClassCase{SpvStorageClassOutput, true, + ast::StorageClass::kOutput}, + StorageClassCase{SpvStorageClassUniform, true, + ast::StorageClass::kUniform}, + StorageClassCase{SpvStorageClassWorkgroup, true, + ast::StorageClass::kWorkgroup}, + StorageClassCase{SpvStorageClassUniformConstant, true, + ast::StorageClass::kNone}, + StorageClassCase{SpvStorageClassStorageBuffer, true, + ast::StorageClass::kStorage}, + StorageClassCase{SpvStorageClassPrivate, true, + ast::StorageClass::kPrivate}, + StorageClassCase{SpvStorageClassFunction, true, + ast::StorageClass::kFunction})); INSTANTIATE_TEST_SUITE_P(EnumConverterBad, SpvStorageClassTest, diff --git a/src/reader/spirv/parser_impl.cc b/src/reader/spirv/parser_impl.cc index f36a8db1ee..4f658f18dc 100644 --- a/src/reader/spirv/parser_impl.cc +++ b/src/reader/spirv/parser_impl.cc @@ -1483,7 +1483,6 @@ bool ParserImpl::EmitModuleScopeVariables() { case ast::StorageClass::kUniform: case ast::StorageClass::kUniformConstant: case ast::StorageClass::kStorage: - case ast::StorageClass::kImage: case ast::StorageClass::kWorkgroup: case ast::StorageClass::kPrivate: break; diff --git a/src/reader/spirv/parser_impl_convert_type_test.cc b/src/reader/spirv/parser_impl_convert_type_test.cc index b580b67e6d..6303b1ac87 100644 --- a/src/reader/spirv/parser_impl_convert_type_test.cc +++ b/src/reader/spirv/parser_impl_convert_type_test.cc @@ -833,22 +833,6 @@ TEST_F(SpvParserTest, ConvertType_PointerStorageBuffer) { EXPECT_TRUE(p->error().empty()); } -TEST_F(SpvParserTest, ConvertType_PointerImage) { - auto p = parser(test::Assemble(Preamble() + R"( - %float = OpTypeFloat 32 - %3 = OpTypePointer Image %float - )" + MainBody())); - EXPECT_TRUE(p->BuildInternalModule()); - - auto* type = p->ConvertType(3); - EXPECT_TRUE(type->Is()); - auto* ptr_ty = type->As(); - EXPECT_NE(ptr_ty, nullptr); - EXPECT_TRUE(ptr_ty->type->Is()); - EXPECT_EQ(ptr_ty->storage_class, ast::StorageClass::kImage); - EXPECT_TRUE(p->error().empty()); -} - TEST_F(SpvParserTest, ConvertType_PointerPrivate) { auto p = parser(test::Assemble(Preamble() + R"( %float = OpTypeFloat 32 diff --git a/src/reader/wgsl/lexer.cc b/src/reader/wgsl/lexer.cc index 04a10b48f3..d9d9f88c5d 100644 --- a/src/reader/wgsl/lexer.cc +++ b/src/reader/wgsl/lexer.cc @@ -971,8 +971,6 @@ Token Lexer::check_keyword(const Source& source, std::string_view str) { return {Token::Type::kI32, source, "i32"}; if (str == "if") return {Token::Type::kIf, source, "if"}; - if (str == "image") - return {Token::Type::kImage, source, "image"}; if (str == "import") return {Token::Type::kImport, source, "import"}; if (str == "let") diff --git a/src/reader/wgsl/lexer_test.cc b/src/reader/wgsl/lexer_test.cc index 0ea9b9acd7..8b331d33b2 100644 --- a/src/reader/wgsl/lexer_test.cc +++ b/src/reader/wgsl/lexer_test.cc @@ -738,7 +738,6 @@ INSTANTIATE_TEST_SUITE_P( TokenData{"function", Token::Type::kFunction}, TokenData{"i32", Token::Type::kI32}, TokenData{"if", Token::Type::kIf}, - TokenData{"image", Token::Type::kImage}, TokenData{"import", Token::Type::kImport}, TokenData{"let", Token::Type::kLet}, TokenData{"loop", Token::Type::kLoop}, diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc index a1c236f2f9..d2ad277865 100644 --- a/src/reader/wgsl/parser_impl.cc +++ b/src/reader/wgsl/parser_impl.cc @@ -1156,7 +1156,6 @@ Expect ParserImpl::expect_type_decl_matrix(Token t) { // | UNIFORM // | WORKGROUP // | STORAGE -// | IMAGE // | PRIVATE // | FUNCTION Expect ParserImpl::expect_storage_class( @@ -1172,9 +1171,6 @@ Expect ParserImpl::expect_storage_class( if (match(Token::Type::kStorage)) return {ast::StorageClass::kStorage, source}; - if (match(Token::Type::kImage)) - return {ast::StorageClass::kImage, source}; - if (match(Token::Type::kPrivate)) return {ast::StorageClass::kPrivate, source}; diff --git a/src/reader/wgsl/parser_impl_storage_class_test.cc b/src/reader/wgsl/parser_impl_storage_class_test.cc index ecd68cd7f8..63d844e160 100644 --- a/src/reader/wgsl/parser_impl_storage_class_test.cc +++ b/src/reader/wgsl/parser_impl_storage_class_test.cc @@ -50,7 +50,6 @@ INSTANTIATE_TEST_SUITE_P( StorageClassData{"workgroup", ast::StorageClass::kWorkgroup}, StorageClassData{"storage", ast::StorageClass::kStorage}, StorageClassData{"storage_buffer", ast::StorageClass::kStorage}, - StorageClassData{"image", ast::StorageClass::kImage}, StorageClassData{"private", ast::StorageClass::kPrivate}, StorageClassData{"function", ast::StorageClass::kFunction})); diff --git a/src/reader/wgsl/parser_impl_variable_qualifier_test.cc b/src/reader/wgsl/parser_impl_variable_qualifier_test.cc index 76ec87a975..db09bdc623 100644 --- a/src/reader/wgsl/parser_impl_variable_qualifier_test.cc +++ b/src/reader/wgsl/parser_impl_variable_qualifier_test.cc @@ -58,8 +58,6 @@ INSTANTIATE_TEST_SUITE_P( ast::Access::kUndefined}, VariableStorageData{"storage_buffer", ast::StorageClass::kStorage, ast::Access::kUndefined}, - VariableStorageData{"image", ast::StorageClass::kImage, - ast::Access::kUndefined}, VariableStorageData{"private", ast::StorageClass::kPrivate, ast::Access::kUndefined}, VariableStorageData{"function", ast::StorageClass::kFunction, diff --git a/src/reader/wgsl/token.cc b/src/reader/wgsl/token.cc index ce462c2d83..6103d0ad95 100644 --- a/src/reader/wgsl/token.cc +++ b/src/reader/wgsl/token.cc @@ -153,8 +153,6 @@ std::string_view Token::TypeToName(Type type) { return "i32"; case Token::Type::kIf: return "if"; - case Token::Type::kImage: - return "image"; case Token::Type::kImport: return "import"; case Token::Type::kLet: diff --git a/src/reader/wgsl/token.h b/src/reader/wgsl/token.h index 0a62ce6c5a..cc40fe0564 100644 --- a/src/reader/wgsl/token.h +++ b/src/reader/wgsl/token.h @@ -163,8 +163,6 @@ class Token { kI32, /// A 'if' kIf, - /// A 'image' - kImage, /// A 'import' kImport, /// A 'let' diff --git a/src/resolver/function_validation_test.cc b/src/resolver/function_validation_test.cc index 62631690bb..92f0f36c88 100644 --- a/src/resolver/function_validation_test.cc +++ b/src/resolver/function_validation_test.cc @@ -823,7 +823,6 @@ INSTANTIATE_TEST_SUITE_P( TestParams{ast::StorageClass::kWorkgroup, true}, TestParams{ast::StorageClass::kUniformConstant, false}, TestParams{ast::StorageClass::kStorage, false}, - TestParams{ast::StorageClass::kImage, false}, TestParams{ast::StorageClass::kPrivate, true}, TestParams{ast::StorageClass::kFunction, true})); diff --git a/src/writer/spirv/builder.cc b/src/writer/spirv/builder.cc index e633bb6b7a..9c37b47925 100644 --- a/src/writer/spirv/builder.cc +++ b/src/writer/spirv/builder.cc @@ -4219,8 +4219,6 @@ SpvStorageClass Builder::ConvertStorageClass(ast::StorageClass klass) const { return SpvStorageClassUniformConstant; case ast::StorageClass::kStorage: return SpvStorageClassStorageBuffer; - case ast::StorageClass::kImage: - return SpvStorageClassImage; case ast::StorageClass::kPrivate: return SpvStorageClassPrivate; case ast::StorageClass::kFunction: diff --git a/src/writer/spirv/builder_type_test.cc b/src/writer/spirv/builder_type_test.cc index 9eb0815356..9a57bc9860 100644 --- a/src/writer/spirv/builder_type_test.cc +++ b/src/writer/spirv/builder_type_test.cc @@ -553,7 +553,6 @@ INSTANTIATE_TEST_SUITE_P( PtrData{ast::StorageClass::kUniformConstant, SpvStorageClassUniformConstant}, PtrData{ast::StorageClass::kStorage, SpvStorageClassStorageBuffer}, - PtrData{ast::StorageClass::kImage, SpvStorageClassImage}, PtrData{ast::StorageClass::kPrivate, SpvStorageClassPrivate}, PtrData{ast::StorageClass::kFunction, SpvStorageClassFunction})); diff --git a/test/unittest/reader/spirv/SpvParserTest_ConvertType_PointerImage.spvasm b/test/unittest/reader/spirv/SpvParserTest_ConvertType_PointerImage.spvasm deleted file mode 100644 index 5acd6eddbb..0000000000 --- a/test/unittest/reader/spirv/SpvParserTest_ConvertType_PointerImage.spvasm +++ /dev/null @@ -1,19 +0,0 @@ -; Test: SpvParserTest_ConvertType_PointerImage.spvasm -; SPIR-V -; Version: 1.0 -; Generator: Khronos SPIR-V Tools Assembler; 0 -; Bound: 7 -; Schema: 0 -OpCapability Shader -OpMemoryModel Logical Simple -OpEntryPoint Fragment %1 "x_100" -OpExecutionMode %1 OriginUpperLeft -%float = OpTypeFloat 32 -%_ptr_Image_float = OpTypePointer Image %float -%void = OpTypeVoid -%5 = OpTypeFunction %void -%1 = OpFunction %void None %5 -%6 = OpLabel -OpReturn -OpFunctionEnd -