Copy IR instruction

This commit is contained in:
Lander Gallastegi 2024-11-12 22:43:42 +01:00
parent bd3371bdfb
commit ed5da0263c
2 changed files with 7 additions and 0 deletions

View File

@ -1619,4 +1619,9 @@ void IREmitter::EmitPrimitive() {
Inst(Opcode::EmitPrimitive); Inst(Opcode::EmitPrimitive);
} }
IR::Inst* IREmitter::CopyInst(const IR::Inst& inst) {
auto it{block->PrependNewInst(insertion_point, inst)};
return &*it;
}
} // namespace Shader::IR } // namespace Shader::IR

View File

@ -321,6 +321,8 @@ public:
void EmitVertex(); void EmitVertex();
void EmitPrimitive(); void EmitPrimitive();
[[nodiscard]] Inst* CopyInst(const Inst& inst);
private: private:
IR::Block::iterator insertion_point; IR::Block::iterator insertion_point;