diff options
Diffstat (limited to 'spirv_msl.cpp')
-rw-r--r-- | spirv_msl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spirv_msl.cpp b/spirv_msl.cpp index e8af45f3..714a97f5 100644 --- a/spirv_msl.cpp +++ b/spirv_msl.cpp @@ -6565,6 +6565,7 @@ void CompilerMSL::declare_constant_arrays() // link into Metal libraries. This is hacky. if (!type.array.empty() && (!fully_inlined || is_scalar(type) || is_vector(type))) { + add_resource_name(c.self); auto name = to_name(c.self); statement(inject_top_level_storage_qualifier(variable_decl(type, name), "constant"), " = ", constant_expression(c), ";"); @@ -6596,6 +6597,7 @@ void CompilerMSL::declare_complex_constant_arrays() auto &type = this->get<SPIRType>(c.constant_type); if (!type.array.empty() && !(is_scalar(type) || is_vector(type))) { + add_resource_name(c.self); auto name = to_name(c.self); statement("", variable_decl(type, name), " = ", constant_expression(c), ";"); emitted = true; @@ -6674,6 +6676,7 @@ void CompilerMSL::emit_specialization_constants_and_structs() { auto &type = get<SPIRType>(c.constant_type); string sc_type_name = type_to_glsl(type); + add_resource_name(c.self); string sc_name = to_name(c.self); string sc_tmp_name = sc_name + "_tmp"; @@ -6716,6 +6719,7 @@ void CompilerMSL::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("constant ", variable_decl(type, name), " = ", constant_op_expression(c), ";"); emitted = true; |