Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-01-18 17:25:17 +0300
committerGitHub <noreply@github.com>2022-01-18 17:25:17 +0300
commit5a29181b357dc572125e7da2b8c24020be848af7 (patch)
tree2b2253b3486fd10b0126c9d4233a80114c1bdde9 /spirv_hlsl.cpp
parent08d5f5ed181f489e77f94d168071fb5605f2792a (diff)
parentac46140ba394ba5f85b6cfc72a5f5810084e8191 (diff)
Merge pull request #1851 from KhronosGroup/fix-1835
Handle aliased names in spec constants.
Diffstat (limited to 'spirv_hlsl.cpp')
-rw-r--r--spirv_hlsl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/spirv_hlsl.cpp b/spirv_hlsl.cpp
index efd8f99f..3d834774 100644
--- a/spirv_hlsl.cpp
+++ b/spirv_hlsl.cpp
@@ -1167,6 +1167,7 @@ void CompilerHLSL::emit_composite_constants()
if (type.basetype == SPIRType::Struct || !type.array.empty())
{
+ add_resource_name(c.self);
auto name = to_name(c.self);
statement("static const ", variable_decl(type, name), " = ", constant_expression(c), ";");
emitted = true;
@@ -1213,6 +1214,7 @@ void CompilerHLSL::emit_specialization_constants_and_structs()
else if (c.specialization)
{
auto &type = get<SPIRType>(c.constant_type);
+ add_resource_name(c.self);
auto name = to_name(c.self);
if (has_decoration(c.self, DecorationSpecId))
@@ -1236,6 +1238,7 @@ void CompilerHLSL::emit_specialization_constants_and_structs()
{
auto &c = id.get<SPIRConstantOp>();
auto &type = get<SPIRType>(c.basetype);
+ add_resource_name(c.self);
auto name = to_name(c.self);
statement("static const ", variable_decl(type, name), " = ", constant_op_expression(c), ";");
emitted = true;