summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-08-15 16:27:43 +0200
committerSubv <subv2112@gmail.com>2018-08-15 16:27:43 +0200
commit91140f6c0a64d77460c9cc740da4d7b20d314157 (patch)
tree22236019768cf55e1e3aaac15b41a7312c95c8f7 /src
parentShader/I2F: Implemented the negate I2F_C instruction variant. (diff)
downloadyuzu-91140f6c0a64d77460c9cc740da4d7b20d314157.tar
yuzu-91140f6c0a64d77460c9cc740da4d7b20d314157.tar.gz
yuzu-91140f6c0a64d77460c9cc740da4d7b20d314157.tar.bz2
yuzu-91140f6c0a64d77460c9cc740da4d7b20d314157.tar.lz
yuzu-91140f6c0a64d77460c9cc740da4d7b20d314157.tar.xz
yuzu-91140f6c0a64d77460c9cc740da4d7b20d314157.tar.zst
yuzu-91140f6c0a64d77460c9cc740da4d7b20d314157.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 218ca5261..e0dfdbb9f 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1250,6 +1250,10 @@ private:
op_a = "abs(" + op_a + ')';
}
+ if (instr.conversion.negate_a) {
+ op_a = "-(" + op_a + ')';
+ }
+
regs.SetRegisterToInteger(instr.gpr0, instr.conversion.is_output_signed, 0, op_a, 1,
1, instr.alu.saturate_d, 0, instr.conversion.dest_size);
break;
@@ -1289,6 +1293,14 @@ private:
ASSERT_MSG(instr.conversion.src_size == Register::Size::Word, "Unimplemented");
std::string op_a = regs.GetRegisterAsFloat(instr.gpr20);
+ if (instr.conversion.abs_a) {
+ op_a = "abs(" + op_a + ')';
+ }
+
+ if (instr.conversion.negate_a) {
+ op_a = "-(" + op_a + ')';
+ }
+
switch (instr.conversion.f2f.rounding) {
case Tegra::Shader::F2fRoundingOp::None:
break;
@@ -1311,10 +1323,6 @@ private:
break;
}
- if (instr.conversion.abs_a) {
- op_a = "abs(" + op_a + ')';
- }
-
regs.SetRegisterToFloat(instr.gpr0, 0, op_a, 1, 1, instr.alu.saturate_d);
break;
}