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_glsl.cpp
parent08d5f5ed181f489e77f94d168071fb5605f2792a (diff)
parentac46140ba394ba5f85b6cfc72a5f5810084e8191 (diff)
Merge pull request #1851 from KhronosGroup/fix-1835
Handle aliased names in spec constants.
Diffstat (limited to 'spirv_glsl.cpp')
-rw-r--r--spirv_glsl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp
index acbeb59a..3cdb742f 100644
--- a/spirv_glsl.cpp
+++ b/spirv_glsl.cpp
@@ -2686,6 +2686,7 @@ string CompilerGLSL::constant_value_macro_name(uint32_t id)
void CompilerGLSL::emit_specialization_constant_op(const SPIRConstantOp &constant)
{
auto &type = get<SPIRType>(constant.basetype);
+ add_resource_name(constant.self);
auto name = to_name(constant.self);
statement("const ", variable_decl(type, name), " = ", constant_op_expression(constant), ";");
}
@@ -2713,7 +2714,6 @@ int CompilerGLSL::get_constant_mapping_to_workgroup_component(const SPIRConstant
void CompilerGLSL::emit_constant(const SPIRConstant &constant)
{
auto &type = get<SPIRType>(constant.constant_type);
- auto name = to_name(constant.self);
SpecializationConstant wg_x, wg_y, wg_z;
ID workgroup_size_id = get_work_group_size_specialization_constants(wg_x, wg_y, wg_z);
@@ -2740,6 +2740,9 @@ void CompilerGLSL::emit_constant(const SPIRConstant &constant)
return;
}
+ add_resource_name(constant.self);
+ auto name = to_name(constant.self);
+
// Only scalars have constant IDs.
if (has_decoration(constant.self, DecorationSpecId))
{