Fix HLSL emission of cbuffers
Despite the documentation claiming otherwise, the DXC doesn't allow these to be anonymous. Change-Id: I853d11970890106b8fd4d6b8bb321940f0658bd3 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35281 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
c82eeeef07
commit
e1bea58ca4
|
@ -1334,7 +1334,9 @@ bool GeneratorImpl::EmitEntryPointData(
|
|||
// is not a block.
|
||||
// Relevant: https://github.com/gpuweb/gpuweb/issues/1004
|
||||
// https://github.com/gpuweb/gpuweb/issues/1008
|
||||
out << "cbuffer : register(b" << binding->value() << ") {" << std::endl;
|
||||
auto name = "cbuffer_" + var->name();
|
||||
out << "cbuffer " << name << " : register(b" << binding->value() << ") {"
|
||||
<< std::endl;
|
||||
|
||||
increment_indent();
|
||||
make_indent(out);
|
||||
|
|
|
@ -268,7 +268,7 @@ TEST_F(HlslGeneratorImplTest_Function,
|
|||
|
||||
ASSERT_TRUE(td.Determine()) << td.error();
|
||||
ASSERT_TRUE(gen.Generate(out)) << gen.error();
|
||||
EXPECT_EQ(result(), R"(cbuffer : register(b0) {
|
||||
EXPECT_EQ(result(), R"(cbuffer cbuffer_coord : register(b0) {
|
||||
float4 coord;
|
||||
};
|
||||
|
||||
|
@ -819,7 +819,7 @@ TEST_F(HlslGeneratorImplTest_Function,
|
|||
|
||||
ASSERT_TRUE(td.Determine()) << td.error();
|
||||
ASSERT_TRUE(gen.Generate(out)) << gen.error();
|
||||
EXPECT_EQ(result(), R"(cbuffer : register(b0) {
|
||||
EXPECT_EQ(result(), R"(cbuffer cbuffer_coord : register(b0) {
|
||||
float4 coord;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue