summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/ir
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-03-24 05:33:45 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:24 +0200
commit68a9505d8a1d00c6ba2739bc0af3069cf87b9b84 (patch)
treeb9a78497cd8af1d73a7eda34cd0df08b3dc324e6 /src/shader_recompiler/frontend/ir
parentshader: Fix use-after-free bug in object_pool (diff)
downloadyuzu-68a9505d8a1d00c6ba2739bc0af3069cf87b9b84.tar
yuzu-68a9505d8a1d00c6ba2739bc0af3069cf87b9b84.tar.gz
yuzu-68a9505d8a1d00c6ba2739bc0af3069cf87b9b84.tar.bz2
yuzu-68a9505d8a1d00c6ba2739bc0af3069cf87b9b84.tar.lz
yuzu-68a9505d8a1d00c6ba2739bc0af3069cf87b9b84.tar.xz
yuzu-68a9505d8a1d00c6ba2739bc0af3069cf87b9b84.tar.zst
yuzu-68a9505d8a1d00c6ba2739bc0af3069cf87b9b84.zip
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp8
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h3
-rw-r--r--src/shader_recompiler/frontend/ir/microinstruction.cpp2
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc4
4 files changed, 17 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index ff2970125..ce610799a 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -92,6 +92,14 @@ void IREmitter::DemoteToHelperInvocation(Block* continue_label) {
Inst(Opcode::DemoteToHelperInvocation, continue_label);
}
+void IREmitter::Prologue() {
+ Inst(Opcode::Prologue);
+}
+
+void IREmitter::Epilogue() {
+ Inst(Opcode::Epilogue);
+}
+
U32 IREmitter::GetReg(IR::Reg reg) {
return Inst<U32>(Opcode::GetRegister, reg);
}
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index 1708be3ef..39109b0de 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -39,6 +39,9 @@ public:
void Return();
void DemoteToHelperInvocation(Block* continue_label);
+ void Prologue();
+ void Epilogue();
+
[[nodiscard]] U32 GetReg(IR::Reg reg);
void SetReg(IR::Reg reg, const U32& value);
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp
index 21b7d8a9f..ba3968056 100644
--- a/src/shader_recompiler/frontend/ir/microinstruction.cpp
+++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp
@@ -56,6 +56,8 @@ bool Inst::MayHaveSideEffects() const noexcept {
case Opcode::SelectionMerge:
case Opcode::Return:
case Opcode::DemoteToHelperInvocation:
+ case Opcode::Prologue:
+ case Opcode::Epilogue:
case Opcode::SetAttribute:
case Opcode::SetAttributeIndexed:
case Opcode::SetFragColor:
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index fe888b8b2..8945c7b04 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -15,6 +15,10 @@ OPCODE(SelectionMerge, Void, Labe
OPCODE(Return, Void, )
OPCODE(DemoteToHelperInvocation, Void, Label, )
+// Special operations
+OPCODE(Prologue, Void, )
+OPCODE(Epilogue, Void, )
+
// Context getters/setters
OPCODE(GetRegister, U32, Reg, )
OPCODE(SetRegister, Void, Reg, U32, )