summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorSebastian Valle <subv2112@gmail.com>2018-07-13 00:36:51 +0200
committerGitHub <noreply@github.com>2018-07-13 00:36:51 +0200
commit274d1fb0fc3d9397a468f191a0c15afc9c86f94c (patch)
tree4425f3888dc42f05a8db16ce10b736a689075ae5 /src/video_core/renderer_opengl
parentMerge pull request #651 from Subv/ffma_decode (diff)
parentGPU: Implement the FADD32I shader instruction. (diff)
downloadyuzu-274d1fb0fc3d9397a468f191a0c15afc9c86f94c.tar
yuzu-274d1fb0fc3d9397a468f191a0c15afc9c86f94c.tar.gz
yuzu-274d1fb0fc3d9397a468f191a0c15afc9c86f94c.tar.bz2
yuzu-274d1fb0fc3d9397a468f191a0c15afc9c86f94c.tar.lz
yuzu-274d1fb0fc3d9397a468f191a0c15afc9c86f94c.tar.xz
yuzu-274d1fb0fc3d9397a468f191a0c15afc9c86f94c.tar.zst
yuzu-274d1fb0fc3d9397a468f191a0c15afc9c86f94c.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 5914077e8..c29cabb84 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -968,6 +968,29 @@ private:
regs.GetRegisterAsFloat(instr.gpr8) + " * " + GetImmediate32(instr), 1, 1);
break;
}
+ case OpCode::Id::FADD32I: {
+ std::string op_a = regs.GetRegisterAsFloat(instr.gpr8);
+ std::string op_b = GetImmediate32(instr);
+
+ if (instr.fadd32i.abs_a) {
+ op_a = "abs(" + op_a + ')';
+ }
+
+ if (instr.fadd32i.negate_a) {
+ op_a = "-(" + op_a + ')';
+ }
+
+ if (instr.fadd32i.abs_b) {
+ op_b = "abs(" + op_b + ')';
+ }
+
+ if (instr.fadd32i.negate_b) {
+ op_b = "-(" + op_b + ')';
+ }
+
+ regs.SetRegisterToFloat(instr.gpr0, 0, op_a + " + " + op_b, 1, 1);
+ break;
+ }
}
break;
}