allow multiple execution modes per entry point
authorJacob Lifshay <programmerjake@gmail.com>
Tue, 15 Aug 2017 23:22:30 +0000 (16:22 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Tue, 15 Aug 2017 23:22:30 +0000 (16:22 -0700)
src/spirv_to_llvm/spirv_to_llvm.cpp

index d23c946135fff21c56b909b9fe96170bc5d9720a..8ea497b28d348e8b281b101a4e520f85897c52e9 100644 (file)
@@ -473,7 +473,7 @@ private:
     {
         Op_entry_point entry_point;
         std::size_t instruction_start_index;
-        util::optional<Execution_mode_with_parameters> execution_mode;
+        std::vector<Execution_mode_with_parameters> execution_modes;
     };
     struct Name
     {
@@ -2846,10 +2846,7 @@ void Spirv_to_llvm::handle_instruction_op_execution_mode(Op_execution_mode instr
             throw Parser_error(instruction_start_index,
                                instruction_start_index,
                                "entry point not defined in OpExecutionMode");
-        if(state.op_entry_points.back().execution_mode)
-            throw Parser_error(
-                instruction_start_index, instruction_start_index, "execution mode already set");
-        state.op_entry_points.back().execution_mode = std::move(instruction.mode);
+        state.op_entry_points.back().execution_modes.push_back(std::move(instruction.mode));
     }
 }