From f9699b2248f198a162ed9bc628aaff2dffffba48 Mon Sep 17 00:00:00 2001 From: David Neto Date: Tue, 22 Jun 2021 19:42:49 +0000 Subject: [PATCH] spirv-reader: further cleanup of legacy IO Bug: tint:508 Change-Id: I0c72cd06db70fa5275fff3bca2ed31febb9f49a9 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55521 Auto-Submit: David Neto Kokoro: Kokoro Commit-Queue: James Price Reviewed-by: James Price --- src/reader/spirv/function.cc | 9 ++------- src/reader/spirv/parser_impl.cc | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/reader/spirv/function.cc b/src/reader/spirv/function.cc index 0b0054f66c..ce244d4144 100644 --- a/src/reader/spirv/function.cc +++ b/src/reader/spirv/function.cc @@ -877,13 +877,8 @@ bool FunctionEmitter::Emit() { bool make_body_function = true; if (ep_info_) { - if (ep_info_->inner_name.empty()) { - // This is an entry point, and we don't want to emit it as a wrapper - // around its own body. Emit it as one function. - decl.name = ep_info_->name; - decl.decorations.emplace_back( - create(Source{}, ep_info_->stage)); - } else if (ep_info_->owns_inner_implementation) { + TINT_ASSERT(!ep_info_->inner_name.empty()); + if (ep_info_->owns_inner_implementation) { // This is an entry point, and we want to emit it as a wrapper around // an implementation function. decl.name = ep_info_->inner_name; diff --git a/src/reader/spirv/parser_impl.cc b/src/reader/spirv/parser_impl.cc index 04029d3d12..94fe563c65 100644 --- a/src/reader/spirv/parser_impl.cc +++ b/src/reader/spirv/parser_impl.cc @@ -833,6 +833,7 @@ bool ParserImpl::RegisterEntryPoints() { // Reuse the inner implementation owned by the first entry point. inner_implementation_name = where->second[0].inner_name; } + TINT_ASSERT(!inner_implementation_name.empty()); TINT_ASSERT(ep_name != inner_implementation_name); tint::UniqueVector inputs;