[inspector] Convert GetRemapped to be a pass through
This is a temporary fix to get Tint rolling into Dawn again and will be removed in a future patch. BUG=tint:273 Change-Id: I632e71711146eb4055f46c1bebfbd6d3ff5772fa Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32520 Reviewed-by: dan sinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
parent
1995ddf876
commit
1980095da7
|
@ -68,13 +68,17 @@ std::vector<EntryPoint> Inspector::GetEntryPoints() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Inspector::GetRemappedNamedForEntryPoint(
|
std::string Inspector::GetRemappedNameForEntryPoint(
|
||||||
const std::string& entry_point) {
|
const std::string& entry_point) {
|
||||||
auto* func = FindEntryPointByName(entry_point);
|
// TODO(rharrison): Reenable once all of the backends are using the renamed
|
||||||
if (!func) {
|
// entry points.
|
||||||
return {};
|
|
||||||
}
|
// auto* func = FindEntryPointByName(entry_point);
|
||||||
return namer_.NameFor(entry_point);
|
// if (!func) {
|
||||||
|
// return {};
|
||||||
|
// }
|
||||||
|
// return namer_.NameFor(entry_point);
|
||||||
|
return entry_point;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<uint32_t, Scalar> Inspector::GetConstantIDs() {
|
std::map<uint32_t, Scalar> Inspector::GetConstantIDs() {
|
||||||
|
|
|
@ -81,7 +81,7 @@ class Inspector {
|
||||||
/// @param entry_point name of the entry point to get the remapped version of
|
/// @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
|
/// @returns the remapped name of the entry point, or the empty string if it
|
||||||
/// isn't a known entry point.
|
/// isn't a known entry point.
|
||||||
std::string GetRemappedNamedForEntryPoint(const std::string& entry_point);
|
std::string GetRemappedNameForEntryPoint(const std::string& entry_point);
|
||||||
|
|
||||||
/// @returns map of const_id to initial value
|
/// @returns map of const_id to initial value
|
||||||
std::map<uint32_t, Scalar> GetConstantIDs();
|
std::map<uint32_t, Scalar> GetConstantIDs();
|
||||||
|
|
|
@ -643,7 +643,7 @@ class InspectorHelper {
|
||||||
|
|
||||||
class InspectorGetEntryPointTest : public InspectorHelper,
|
class InspectorGetEntryPointTest : public InspectorHelper,
|
||||||
public testing::Test {};
|
public testing::Test {};
|
||||||
class InspectorGetRemappedNamedForEntryPointTest : public InspectorHelper,
|
class InspectorGetRemappedNameForEntryPointTest : public InspectorHelper,
|
||||||
public testing::Test {};
|
public testing::Test {};
|
||||||
class InspectorGetConstantIDsTest : public InspectorHelper,
|
class InspectorGetConstantIDsTest : public InspectorHelper,
|
||||||
public testing::Test {};
|
public testing::Test {};
|
||||||
|
@ -1000,35 +1000,44 @@ TEST_F(InspectorGetEntryPointTest, MultipleEntryPointsSharedInOutVariables) {
|
||||||
EXPECT_EQ("out2_var", result[1].output_variables[0]);
|
EXPECT_EQ("out2_var", result[1].output_variables[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(InspectorGetRemappedNamedForEntryPointTest, NoFunctions) {
|
// TODO(rharrison): Reenable once GetRemappedNameForEntryPoint isn't a pass
|
||||||
auto result = inspector()->GetRemappedNamedForEntryPoint("foo");
|
// through
|
||||||
|
TEST_F(InspectorGetRemappedNameForEntryPointTest, DISABLED_NoFunctions) {
|
||||||
|
auto result = inspector()->GetRemappedNameForEntryPoint("foo");
|
||||||
ASSERT_TRUE(inspector()->has_error());
|
ASSERT_TRUE(inspector()->has_error());
|
||||||
|
|
||||||
EXPECT_EQ("", result);
|
EXPECT_EQ("", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(InspectorGetRemappedNamedForEntryPointTest, NoEntryPoints) {
|
// TODO(rharrison): Reenable once GetRemappedNameForEntryPoint isn't a pass
|
||||||
|
// through
|
||||||
|
TEST_F(InspectorGetRemappedNameForEntryPointTest, DISABLED_NoEntryPoints) {
|
||||||
mod()->AddFunction(MakeEmptyBodyFunction("foo"));
|
mod()->AddFunction(MakeEmptyBodyFunction("foo"));
|
||||||
|
|
||||||
auto result = inspector()->GetRemappedNamedForEntryPoint("foo");
|
auto result = inspector()->GetRemappedNameForEntryPoint("foo");
|
||||||
ASSERT_TRUE(inspector()->has_error());
|
ASSERT_TRUE(inspector()->has_error());
|
||||||
|
|
||||||
EXPECT_EQ("", result);
|
EXPECT_EQ("", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(InspectorGetRemappedNamedForEntryPointTest, OneEntryPoint) {
|
// TODO(rharrison): Reenable once GetRemappedNameForEntryPoint isn't a pass
|
||||||
|
// through
|
||||||
|
TEST_F(InspectorGetRemappedNameForEntryPointTest, DISABLED_OneEntryPoint) {
|
||||||
auto foo = MakeEmptyBodyFunction("foo");
|
auto foo = MakeEmptyBodyFunction("foo");
|
||||||
foo->add_decoration(std::make_unique<ast::StageDecoration>(
|
foo->add_decoration(std::make_unique<ast::StageDecoration>(
|
||||||
ast::PipelineStage::kVertex, Source{}));
|
ast::PipelineStage::kVertex, Source{}));
|
||||||
mod()->AddFunction(std::move(foo));
|
mod()->AddFunction(std::move(foo));
|
||||||
|
|
||||||
auto result = inspector()->GetRemappedNamedForEntryPoint("foo");
|
auto result = inspector()->GetRemappedNameForEntryPoint("foo");
|
||||||
ASSERT_FALSE(inspector()->has_error()) << inspector()->error();
|
ASSERT_FALSE(inspector()->has_error()) << inspector()->error();
|
||||||
|
|
||||||
EXPECT_EQ("tint_666f6f", result);
|
EXPECT_EQ("tint_666f6f", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(InspectorGetRemappedNamedForEntryPointTest, MultipleEntryPoints) {
|
// TODO(rharrison): Reenable once GetRemappedNameForEntryPoint isn't a pass
|
||||||
|
// through
|
||||||
|
TEST_F(InspectorGetRemappedNameForEntryPointTest,
|
||||||
|
DISABLED_MultipleEntryPoints) {
|
||||||
auto foo = MakeEmptyBodyFunction("foo");
|
auto foo = MakeEmptyBodyFunction("foo");
|
||||||
foo->add_decoration(std::make_unique<ast::StageDecoration>(
|
foo->add_decoration(std::make_unique<ast::StageDecoration>(
|
||||||
ast::PipelineStage::kVertex, Source{}));
|
ast::PipelineStage::kVertex, Source{}));
|
||||||
|
@ -1040,12 +1049,12 @@ TEST_F(InspectorGetRemappedNamedForEntryPointTest, MultipleEntryPoints) {
|
||||||
mod()->AddFunction(std::move(bar));
|
mod()->AddFunction(std::move(bar));
|
||||||
|
|
||||||
{
|
{
|
||||||
auto result = inspector()->GetRemappedNamedForEntryPoint("foo");
|
auto result = inspector()->GetRemappedNameForEntryPoint("foo");
|
||||||
ASSERT_FALSE(inspector()->has_error()) << inspector()->error();
|
ASSERT_FALSE(inspector()->has_error()) << inspector()->error();
|
||||||
EXPECT_EQ("tint_666f6f", result);
|
EXPECT_EQ("tint_666f6f", result);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto result = inspector()->GetRemappedNamedForEntryPoint("bar");
|
auto result = inspector()->GetRemappedNameForEntryPoint("bar");
|
||||||
ASSERT_FALSE(inspector()->has_error()) << inspector()->error();
|
ASSERT_FALSE(inspector()->has_error()) << inspector()->error();
|
||||||
EXPECT_EQ("tint_626172", result);
|
EXPECT_EQ("tint_626172", result);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue