[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;
|
||||
}
|
||||
|
||||
std::string Inspector::GetRemappedNamedForEntryPoint(
|
||||
std::string Inspector::GetRemappedNameForEntryPoint(
|
||||
const std::string& entry_point) {
|
||||
auto* func = FindEntryPointByName(entry_point);
|
||||
if (!func) {
|
||||
return {};
|
||||
}
|
||||
return namer_.NameFor(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 namer_.NameFor(entry_point);
|
||||
return entry_point;
|
||||
}
|
||||
|
||||
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
|
||||
/// @returns the remapped name of the entry point, or the empty string if it
|
||||
/// 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
|
||||
std::map<uint32_t, Scalar> GetConstantIDs();
|
||||
|
|
|
@ -643,8 +643,8 @@ class InspectorHelper {
|
|||
|
||||
class InspectorGetEntryPointTest : public InspectorHelper,
|
||||
public testing::Test {};
|
||||
class InspectorGetRemappedNamedForEntryPointTest : public InspectorHelper,
|
||||
public testing::Test {};
|
||||
class InspectorGetRemappedNameForEntryPointTest : public InspectorHelper,
|
||||
public testing::Test {};
|
||||
class InspectorGetConstantIDsTest : public InspectorHelper,
|
||||
public testing::Test {};
|
||||
class InspectorGetUniformBufferResourceBindingsTest : public InspectorHelper,
|
||||
|
@ -1000,35 +1000,44 @@ TEST_F(InspectorGetEntryPointTest, MultipleEntryPointsSharedInOutVariables) {
|
|||
EXPECT_EQ("out2_var", result[1].output_variables[0]);
|
||||
}
|
||||
|
||||
TEST_F(InspectorGetRemappedNamedForEntryPointTest, NoFunctions) {
|
||||
auto result = inspector()->GetRemappedNamedForEntryPoint("foo");
|
||||
// TODO(rharrison): Reenable once GetRemappedNameForEntryPoint isn't a pass
|
||||
// through
|
||||
TEST_F(InspectorGetRemappedNameForEntryPointTest, DISABLED_NoFunctions) {
|
||||
auto result = inspector()->GetRemappedNameForEntryPoint("foo");
|
||||
ASSERT_TRUE(inspector()->has_error());
|
||||
|
||||
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"));
|
||||
|
||||
auto result = inspector()->GetRemappedNamedForEntryPoint("foo");
|
||||
auto result = inspector()->GetRemappedNameForEntryPoint("foo");
|
||||
ASSERT_TRUE(inspector()->has_error());
|
||||
|
||||
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");
|
||||
foo->add_decoration(std::make_unique<ast::StageDecoration>(
|
||||
ast::PipelineStage::kVertex, Source{}));
|
||||
mod()->AddFunction(std::move(foo));
|
||||
|
||||
auto result = inspector()->GetRemappedNamedForEntryPoint("foo");
|
||||
auto result = inspector()->GetRemappedNameForEntryPoint("foo");
|
||||
ASSERT_FALSE(inspector()->has_error()) << inspector()->error();
|
||||
|
||||
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");
|
||||
foo->add_decoration(std::make_unique<ast::StageDecoration>(
|
||||
ast::PipelineStage::kVertex, Source{}));
|
||||
|
@ -1040,12 +1049,12 @@ TEST_F(InspectorGetRemappedNamedForEntryPointTest, MultipleEntryPoints) {
|
|||
mod()->AddFunction(std::move(bar));
|
||||
|
||||
{
|
||||
auto result = inspector()->GetRemappedNamedForEntryPoint("foo");
|
||||
auto result = inspector()->GetRemappedNameForEntryPoint("foo");
|
||||
ASSERT_FALSE(inspector()->has_error()) << inspector()->error();
|
||||
EXPECT_EQ("tint_666f6f", result);
|
||||
}
|
||||
{
|
||||
auto result = inspector()->GetRemappedNamedForEntryPoint("bar");
|
||||
auto result = inspector()->GetRemappedNameForEntryPoint("bar");
|
||||
ASSERT_FALSE(inspector()->has_error()) << inspector()->error();
|
||||
EXPECT_EQ("tint_626172", result);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue