[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>
This commit is contained in:
dan sinclair 2020-11-12 15:42:20 +00:00 committed by Commit Bot service account
parent 2b706110f6
commit 1995ddf876
3 changed files with 14 additions and 8 deletions

View File

@ -419,8 +419,14 @@ bool Builder::GenerateEntryPoint(ast::Function* func, uint32_t id) {
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

View File

@ -49,7 +49,7 @@ TEST_F(BuilderTest, FunctionDecoration_Stage) {
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 @@ OpName %11 "tint_6d61696e"
%9 = OpTypeFunction %10
)");
EXPECT_EQ(DumpInstructions(b.entry_points()),
R"(OpEntryPoint Vertex %11 "tint_6d61696e"
R"(OpEntryPoint Vertex %11 "main"
)");
}
@ -203,7 +203,7 @@ OpName %11 "tint_6d61696e"
%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 @@ TEST_F(BuilderTest, FunctionDecoration_ExecutionMode_MultipleFragment) {
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"

View File

@ -261,8 +261,8 @@ TEST_F(BuilderTest, Emit_Multiple_EntryPoint_With_Same_ModuleVar) {
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"