[spirv-writer] Revert change to entry point name.
This CL rolls the entry point name change back for the spirv-backend to
allow Dawn to continue to work.
We'll need to roll this together with the inspector change, MSL and HLSL
changes.
Bug: tint:273
Change-Id: I54e7e05a4c277d6c55bd6808f50fb0c7903bc418
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32500
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/src/writer/spirv/builder.cc b/src/writer/spirv/builder.cc
index 3af0441..9462723 100644
--- a/src/writer/spirv/builder.cc
+++ b/src/writer/spirv/builder.cc
@@ -419,8 +419,14 @@
return false;
}
+ // TODO(dsinclair): This should be using the namer to update the entry point
+ // name to a non-user provided string. Disable for now until we can update
+ // the inspector and land the same change in MSL / HLSL to all roll into Dawn
+ // at the same time.
+ // OperandList operands = {Operand::Int(stage), Operand::Int(id),
+ // Operand::String(namer_.NameFor(func->name()))};
OperandList operands = {Operand::Int(stage), Operand::Int(id),
- Operand::String(namer_.NameFor(func->name()))};
+ Operand::String(func->name())};
for (const auto* var : func->referenced_module_variables()) {
// For SPIR-V 1.3 we only output Input/output variables. If we update to
diff --git a/src/writer/spirv/builder_function_decoration_test.cc b/src/writer/spirv/builder_function_decoration_test.cc
index 452efd2..1554bc2 100644
--- a/src/writer/spirv/builder_function_decoration_test.cc
+++ b/src/writer/spirv/builder_function_decoration_test.cc
@@ -49,7 +49,7 @@
Builder b(&mod);
ASSERT_TRUE(b.GenerateFunction(&func)) << b.error();
EXPECT_EQ(DumpInstructions(b.entry_points()),
- R"(OpEntryPoint Vertex %3 "tint_6d61696e"
+ R"(OpEntryPoint Vertex %3 "main"
)");
}
@@ -134,7 +134,7 @@
%9 = OpTypeFunction %10
)");
EXPECT_EQ(DumpInstructions(b.entry_points()),
- R"(OpEntryPoint Vertex %11 "tint_6d61696e"
+ R"(OpEntryPoint Vertex %11 "main"
)");
}
@@ -203,7 +203,7 @@
%9 = OpTypeFunction %10
)");
EXPECT_EQ(DumpInstructions(b.entry_points()),
- R"(OpEntryPoint Vertex %11 "tint_6d61696e" %4 %1
+ R"(OpEntryPoint Vertex %11 "main" %4 %1
)");
}
@@ -270,8 +270,8 @@
ASSERT_TRUE(b.GenerateFunction(&func1)) << b.error();
ASSERT_TRUE(b.GenerateFunction(&func2)) << b.error();
EXPECT_EQ(DumpBuilder(b),
- R"(OpEntryPoint Fragment %3 "tint_6d61696e31"
-OpEntryPoint Fragment %5 "tint_6d61696e32"
+ R"(OpEntryPoint Fragment %3 "main1"
+OpEntryPoint Fragment %5 "main2"
OpExecutionMode %3 OriginUpperLeft
OpExecutionMode %5 OriginUpperLeft
OpName %3 "tint_6d61696e31"
diff --git a/src/writer/spirv/builder_function_test.cc b/src/writer/spirv/builder_function_test.cc
index 6b540de..5677d76 100644
--- a/src/writer/spirv/builder_function_test.cc
+++ b/src/writer/spirv/builder_function_test.cc
@@ -261,8 +261,8 @@
ASSERT_TRUE(b.Build());
EXPECT_EQ(DumpBuilder(b), R"(OpCapability Shader
OpMemoryModel Logical GLSL450
-OpEntryPoint GLCompute %7 "tint_61"
-OpEntryPoint GLCompute %17 "tint_62"
+OpEntryPoint GLCompute %7 "a"
+OpEntryPoint GLCompute %17 "b"
OpExecutionMode %7 LocalSize 1 1 1
OpExecutionMode %17 LocalSize 1 1 1
OpName %3 "tint_44617461"