summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/ir/ir_emitter.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-03-19 23:28:31 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:23 +0200
commit260743f371236f7c57b01334b1c3474b15a47c39 (patch)
tree312d89fa8215199ef5f7ec1fc84b025df526e107 /src/shader_recompiler/frontend/ir/ir_emitter.cpp
parentshader: Implement DADD (diff)
downloadyuzu-260743f371236f7c57b01334b1c3474b15a47c39.tar
yuzu-260743f371236f7c57b01334b1c3474b15a47c39.tar.gz
yuzu-260743f371236f7c57b01334b1c3474b15a47c39.tar.bz2
yuzu-260743f371236f7c57b01334b1c3474b15a47c39.tar.lz
yuzu-260743f371236f7c57b01334b1c3474b15a47c39.tar.xz
yuzu-260743f371236f7c57b01334b1c3474b15a47c39.tar.zst
yuzu-260743f371236f7c57b01334b1c3474b15a47c39.zip
Diffstat (limited to 'src/shader_recompiler/frontend/ir/ir_emitter.cpp')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index 958282160..672836c0b 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -82,6 +82,12 @@ void IREmitter::Return() {
Inst(Opcode::Return);
}
+void IREmitter::DemoteToHelperInvocation(Block* continue_label) {
+ block->SetBranch(continue_label);
+ continue_label->AddImmediatePredecessor(block);
+ Inst(Opcode::DemoteToHelperInvocation, continue_label);
+}
+
U32 IREmitter::GetReg(IR::Reg reg) {
return Inst<U32>(Opcode::GetRegister, reg);
}
@@ -248,6 +254,14 @@ void IREmitter::SetAttribute(IR::Attribute attribute, const F32& value) {
Inst(Opcode::SetAttribute, attribute, value);
}
+void IREmitter::SetFragColor(u32 index, u32 component, const F32& value) {
+ Inst(Opcode::SetFragColor, Imm32(index), Imm32(component), value);
+}
+
+void IREmitter::SetFragDepth(const F32& value) {
+ Inst(Opcode::SetFragDepth, value);
+}
+
U32 IREmitter::WorkgroupIdX() {
return U32{CompositeExtract(Inst(Opcode::WorkgroupId), 0)};
}