From 7fc78af3e612fe9de5c56cc9976c78b921d7ca7e Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Sun, 24 Sep 2017 16:47:54 -0700 Subject: [PATCH] fix duplicate decorations --- src/spirv_to_llvm/core_instructions.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/spirv_to_llvm/core_instructions.cpp b/src/spirv_to_llvm/core_instructions.cpp index 172a0aa..1d4b766 100644 --- a/src/spirv_to_llvm/core_instructions.cpp +++ b/src/spirv_to_llvm/core_instructions.cpp @@ -1769,14 +1769,16 @@ void Spirv_to_llvm::handle_instruction_op_in_bounds_ptr_access_chain( void Spirv_to_llvm::handle_instruction_op_decorate( Op_decorate instruction, [[gnu::unused]] std::size_t instruction_start_index) { - get_id_state(instruction.target).decorations.push_back(std::move(instruction.decoration)); + if(stage == util::Enum_traits::values[0]) + get_id_state(instruction.target).decorations.push_back(std::move(instruction.decoration)); } void Spirv_to_llvm::handle_instruction_op_member_decorate( Op_member_decorate instruction, [[gnu::unused]] std::size_t instruction_start_index) { - auto &state = get_id_state(instruction.structure_type); - state.member_decorations.push_back(std::move(instruction)); + if(stage == util::Enum_traits::values[0]) + get_id_state(instruction.structure_type) + .member_decorations.push_back(std::move(instruction)); } void Spirv_to_llvm::handle_instruction_op_decoration_group(Op_decoration_group instruction, -- 2.30.2