From b37221a1cbf0a3079a1e24b6207880330217a293 Mon Sep 17 00:00:00 2001 From: James Price Date: Fri, 4 Mar 2022 12:55:13 +0000 Subject: [PATCH] inspector: Remove GetRemappedNameForEntryPoint Entry points are renamed via the Renamer transform which returns the remapped names for Dawn to use. Change-Id: Id4a462a95de34c826a8a7ac1878e1d5982a269c2 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/82680 Kokoro: Kokoro Reviewed-by: Ben Clayton --- src/tint/fuzzers/tint_common_fuzzer.cc | 3 -- src/tint/inspector/inspector.cc | 13 ----- src/tint/inspector/inspector.h | 5 -- src/tint/inspector/inspector_test.cc | 71 -------------------------- 4 files changed, 92 deletions(-) diff --git a/src/tint/fuzzers/tint_common_fuzzer.cc b/src/tint/fuzzers/tint_common_fuzzer.cc index 80f5797d8a..b8bfe085ca 100644 --- a/src/tint/fuzzers/tint_common_fuzzer.cc +++ b/src/tint/fuzzers/tint_common_fuzzer.cc @@ -299,9 +299,6 @@ void CommonFuzzer::RunInspector(Program* program) { CHECK_INSPECTOR(program, inspector); for (auto& ep : entry_points) { - inspector.GetRemappedNameForEntryPoint(ep.name); - CHECK_INSPECTOR(program, inspector); - inspector.GetStorageSize(ep.name); CHECK_INSPECTOR(program, inspector); diff --git a/src/tint/inspector/inspector.cc b/src/tint/inspector/inspector.cc index ed493712dd..d4f9b5e032 100644 --- a/src/tint/inspector/inspector.cc +++ b/src/tint/inspector/inspector.cc @@ -227,19 +227,6 @@ std::vector Inspector::GetEntryPoints() { return result; } -std::string Inspector::GetRemappedNameForEntryPoint( - const std::string& entry_point) { - // TODO(rharrison): Reenable once all of the backends are using the renamed - // entry points. - - // auto* func = FindEntryPointByName(entry_point); - // if (!func) { - // return {}; - // } - // return func->name(); - return entry_point; -} - std::map Inspector::GetConstantIDs() { std::map result; for (auto* var : program_->AST().GlobalVariables()) { diff --git a/src/tint/inspector/inspector.h b/src/tint/inspector/inspector.h index 1fa2d00798..df0ccab139 100644 --- a/src/tint/inspector/inspector.h +++ b/src/tint/inspector/inspector.h @@ -53,11 +53,6 @@ class Inspector { /// @returns vector of entry point information std::vector GetEntryPoints(); - /// @param entry_point name of the entry point to get the remapped version of - /// @returns the remapped name of the entry point, or the empty string if it - /// isn't a known entry point. - std::string GetRemappedNameForEntryPoint(const std::string& entry_point); - /// @returns map of const_id to initial value std::map GetConstantIDs(); diff --git a/src/tint/inspector/inspector_test.cc b/src/tint/inspector/inspector_test.cc index 36d54b9437..a1c3ba7eb6 100644 --- a/src/tint/inspector/inspector_test.cc +++ b/src/tint/inspector/inspector_test.cc @@ -63,8 +63,6 @@ class InspectorGetEntryPointInterpolateTest : public InspectorBuilder, public testing::TestWithParam< InspectorGetEntryPointInterpolateTestParams> {}; -class InspectorGetRemappedNameForEntryPointTest : public InspectorBuilder, - public testing::Test {}; class InspectorGetConstantIDsTest : public InspectorBuilder, public testing::Test {}; class InspectorGetConstantNameToIdMapTest : public InspectorBuilder, @@ -1024,75 +1022,6 @@ INSTANTIATE_TEST_SUITE_P( ast::InterpolationType::kFlat, ast::InterpolationSampling::kNone, InterpolationType::kFlat, InterpolationSampling::kNone})); -// TODO(rharrison): Reenable once GetRemappedNameForEntryPoint isn't a pass -// through -TEST_F(InspectorGetRemappedNameForEntryPointTest, DISABLED_NoFunctions) { - Inspector& inspector = Build(); - - auto result = inspector.GetRemappedNameForEntryPoint("foo"); - ASSERT_TRUE(inspector.has_error()); - - EXPECT_EQ("", result); -} - -// TODO(rharrison): Reenable once GetRemappedNameForEntryPoint isn't a pass -// through -TEST_F(InspectorGetRemappedNameForEntryPointTest, DISABLED_NoEntryPoints) { - Inspector& inspector = Build(); - - auto result = inspector.GetRemappedNameForEntryPoint("foo"); - ASSERT_TRUE(inspector.has_error()); - - EXPECT_EQ("", result); -} - -// TODO(rharrison): Reenable once GetRemappedNameForEntryPoint isn't a pass -// through -TEST_F(InspectorGetRemappedNameForEntryPointTest, DISABLED_OneEntryPoint) { - MakeEmptyBodyFunction("foo", ast::AttributeList{ - Stage(ast::PipelineStage::kVertex), - }); - - // TODO(dsinclair): Update to run the namer transform when - // available. - - Inspector& inspector = Build(); - - auto result = inspector.GetRemappedNameForEntryPoint("foo"); - ASSERT_FALSE(inspector.has_error()) << inspector.error(); - - EXPECT_EQ("foo", result); -} - -// TODO(rharrison): Reenable once GetRemappedNameForEntryPoint isn't a pass -// through -TEST_F(InspectorGetRemappedNameForEntryPointTest, - DISABLED_MultipleEntryPoints) { - MakeEmptyBodyFunction("foo", ast::AttributeList{ - Stage(ast::PipelineStage::kVertex), - }); - - // TODO(dsinclair): Update to run the namer transform when - // available. - - MakeEmptyBodyFunction("bar", - ast::AttributeList{Stage(ast::PipelineStage::kCompute), - WorkgroupSize(1)}); - - Inspector& inspector = Build(); - - { - auto result = inspector.GetRemappedNameForEntryPoint("foo"); - ASSERT_FALSE(inspector.has_error()) << inspector.error(); - EXPECT_EQ("foo", result); - } - { - auto result = inspector.GetRemappedNameForEntryPoint("bar"); - ASSERT_FALSE(inspector.has_error()) << inspector.error(); - EXPECT_EQ("bar", result); - } -} - TEST_F(InspectorGetConstantIDsTest, Bool) { AddOverridableConstantWithID("foo", 1, ty.bool_(), nullptr); AddOverridableConstantWithID("bar", 20, ty.bool_(), Expr(true));