summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir
diff options
context:
space:
mode:
authorGravatar lat9nq2021-07-08 17:22:31 -0400
committerGravatar ameerj2021-07-22 21:51:35 -0400
commit373f75d944473731408d7a72c967d5c4b37af5bb (patch)
treea6af34845e9cae1429bbd004a36b324bb02f9932 /src/shader_recompiler/frontend/ir
parentshader: Comment why the array component is not read in TMML (diff)
downloadyuzu-373f75d944473731408d7a72c967d5c4b37af5bb.tar.gz
yuzu-373f75d944473731408d7a72c967d5c4b37af5bb.tar.xz
yuzu-373f75d944473731408d7a72c967d5c4b37af5bb.zip
shader: Add shader loop safety check settings
Also add a setting for enable Nsight Aftermath.
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.cpp14
-rw-r--r--src/shader_recompiler/frontend/ir/ir_emitter.h3
-rw-r--r--src/shader_recompiler/frontend/ir/opcodes.inc2
3 files changed, 17 insertions, 2 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
index e9fd41237..6c37af5e7 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp
@@ -125,6 +125,12 @@ U1 IREmitter::GetPred(IR::Pred pred, bool is_negated) {
125 } 125 }
126} 126}
127 127
128void IREmitter::SetPred(IR::Pred pred, const U1& value) {
129 if (pred != IR::Pred::PT) {
130 Inst(Opcode::SetPred, pred, value);
131 }
132}
133
128U1 IREmitter::GetGotoVariable(u32 id) { 134U1 IREmitter::GetGotoVariable(u32 id) {
129 return Inst<U1>(Opcode::GetGotoVariable, id); 135 return Inst<U1>(Opcode::GetGotoVariable, id);
130} 136}
@@ -141,8 +147,12 @@ void IREmitter::SetIndirectBranchVariable(const U32& value) {
141 Inst(Opcode::SetIndirectBranchVariable, value); 147 Inst(Opcode::SetIndirectBranchVariable, value);
142} 148}
143 149
144void IREmitter::SetPred(IR::Pred pred, const U1& value) { 150U32 IREmitter::GetLoopSafetyVariable(u32 id) {
145 Inst(Opcode::SetPred, pred, value); 151 return Inst<U32>(Opcode::GetLoopSafetyVariable, id);
152}
153
154void IREmitter::SetLoopSafetyVariable(u32 id, const U32& counter) {
155 Inst(Opcode::SetLoopSafetyVariable, id, counter);
146} 156}
147 157
148U32 IREmitter::GetCbuf(const U32& binding, const U32& byte_offset) { 158U32 IREmitter::GetCbuf(const U32& binding, const U32& byte_offset) {
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h
index bb3500c54..7caab1f61 100644
--- a/src/shader_recompiler/frontend/ir/ir_emitter.h
+++ b/src/shader_recompiler/frontend/ir/ir_emitter.h
@@ -55,6 +55,9 @@ public:
55 [[nodiscard]] U32 GetIndirectBranchVariable(); 55 [[nodiscard]] U32 GetIndirectBranchVariable();
56 void SetIndirectBranchVariable(const U32& value); 56 void SetIndirectBranchVariable(const U32& value);
57 57
58 [[nodiscard]] U32 GetLoopSafetyVariable(u32 id);
59 void SetLoopSafetyVariable(u32 id, const U32& counter);
60
58 [[nodiscard]] U32 GetCbuf(const U32& binding, const U32& byte_offset); 61 [[nodiscard]] U32 GetCbuf(const U32& binding, const U32& byte_offset);
59 [[nodiscard]] Value GetCbuf(const U32& binding, const U32& byte_offset, size_t bitsize, 62 [[nodiscard]] Value GetCbuf(const U32& binding, const U32& byte_offset, size_t bitsize,
60 bool is_signed); 63 bool is_signed);
diff --git a/src/shader_recompiler/frontend/ir/opcodes.inc b/src/shader_recompiler/frontend/ir/opcodes.inc
index 8a8d0d759..e87aeddd5 100644
--- a/src/shader_recompiler/frontend/ir/opcodes.inc
+++ b/src/shader_recompiler/frontend/ir/opcodes.inc
@@ -32,6 +32,8 @@ OPCODE(GetGotoVariable, U1, U32,
32OPCODE(SetGotoVariable, Void, U32, U1, ) 32OPCODE(SetGotoVariable, Void, U32, U1, )
33OPCODE(GetIndirectBranchVariable, U32, ) 33OPCODE(GetIndirectBranchVariable, U32, )
34OPCODE(SetIndirectBranchVariable, Void, U32, ) 34OPCODE(SetIndirectBranchVariable, Void, U32, )
35OPCODE(GetLoopSafetyVariable, U32, U32, )
36OPCODE(SetLoopSafetyVariable, Void, U32, U32, )
35OPCODE(GetCbufU8, U32, U32, U32, ) 37OPCODE(GetCbufU8, U32, U32, U32, )
36OPCODE(GetCbufS8, U32, U32, U32, ) 38OPCODE(GetCbufS8, U32, U32, U32, )
37OPCODE(GetCbufU16, U32, U32, U32, ) 39OPCODE(GetCbufU16, U32, U32, U32, )