diff --git a/src/ast/struct.cc b/src/ast/struct.cc index 7868caa487..a5f166f1af 100644 --- a/src/ast/struct.cc +++ b/src/ast/struct.cc @@ -44,10 +44,6 @@ Struct::Struct(Struct&&) = default; Struct::~Struct() = default; -bool Struct::IsBlockDecorated() const { - return HasDecoration(decorations); -} - const Struct* Struct::Clone(CloneContext* ctx) const { // Clone arguments outside of create() call to have deterministic ordering auto src = ctx->Clone(source); diff --git a/src/ast/struct.h b/src/ast/struct.h index f3a08c9307..dd3ffa2360 100644 --- a/src/ast/struct.h +++ b/src/ast/struct.h @@ -44,9 +44,6 @@ class Struct : public Castable { ~Struct() override; - /// @returns true if the struct is block decorated - bool IsBlockDecorated() const; - /// Clones this node and all transitive child nodes using the `CloneContext` /// `ctx`. /// @param ctx the clone context diff --git a/src/inspector/inspector.cc b/src/inspector/inspector.cc index 5fead48540..c011a8e5c4 100644 --- a/src/inspector/inspector.cc +++ b/src/inspector/inspector.cc @@ -318,7 +318,7 @@ uint32_t Inspector::GetStorageSize(const std::string& entry_point) { auto* func_sem = program_->Sem().Get(func); for (auto& ruv : func_sem->TransitivelyReferencedUniformVariables()) { const sem::Struct* s = ruv.first->Type()->UnwrapRef()->As(); - if (s && s->IsBlockDecorated()) { + if (s) { size += s->Size(); } } @@ -382,10 +382,6 @@ std::vector Inspector::GetUniformBufferResourceBindings( continue; } - if (!str->IsBlockDecorated()) { - continue; - } - ResourceBinding entry; entry.resource_type = ResourceBinding::ResourceType::kUniformBuffer; entry.bind_group = binding_info.group->value; diff --git a/src/reader/wgsl/parser_impl_global_decl_test.cc b/src/reader/wgsl/parser_impl_global_decl_test.cc index 97ec4878db..ff21c57df2 100644 --- a/src/reader/wgsl/parser_impl_global_decl_test.cc +++ b/src/reader/wgsl/parser_impl_global_decl_test.cc @@ -182,7 +182,6 @@ TEST_F(ParserImplTest, GlobalDecl_Struct_WithStride) { auto* str = t->As(); EXPECT_EQ(str->name, program.Symbols().Get("A")); EXPECT_EQ(str->members.size(), 1u); - EXPECT_FALSE(str->IsBlockDecorated()); const auto* ty = str->members[0]->type; ASSERT_TRUE(ty->Is()); @@ -209,7 +208,6 @@ TEST_F(ParserImplTest, GlobalDecl_Struct_WithDecoration) { auto* str = t->As(); EXPECT_EQ(str->name, program.Symbols().Get("A")); EXPECT_EQ(str->members.size(), 1u); - EXPECT_TRUE(str->IsBlockDecorated()); } TEST_F(ParserImplTest, GlobalDecl_Struct_Invalid) { diff --git a/src/sem/struct.h b/src/sem/struct.h index 3e3b62d502..d7eab4bd2e 100644 --- a/src/sem/struct.h +++ b/src/sem/struct.h @@ -142,9 +142,6 @@ class Struct : public Castable { return pipeline_stage_uses_; } - /// @returns true if the struct has a block decoration - bool IsBlockDecorated() const { return declaration_->IsBlockDecorated(); } - /// @returns the name for the type std::string type_name() const override;