summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/engines/shader_bytecode.h9
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp23
2 files changed, 32 insertions, 0 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index bdf97e77f..ab978c2e2 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -298,6 +298,13 @@ union Instruction {
298 } iadd32i; 298 } iadd32i;
299 299
300 union { 300 union {
301 BitField<53, 1, u64> negate_b;
302 BitField<54, 1, u64> abs_a;
303 BitField<56, 1, u64> negate_a;
304 BitField<57, 1, u64> abs_b;
305 } fadd32i;
306
307 union {
301 BitField<20, 8, u64> shift_position; 308 BitField<20, 8, u64> shift_position;
302 BitField<28, 8, u64> shift_length; 309 BitField<28, 8, u64> shift_length;
303 BitField<48, 1, u64> negate_b; 310 BitField<48, 1, u64> negate_b;
@@ -487,6 +494,7 @@ public:
487 FADD_C, 494 FADD_C,
488 FADD_R, 495 FADD_R,
489 FADD_IMM, 496 FADD_IMM,
497 FADD32I,
490 FMUL_C, 498 FMUL_C,
491 FMUL_R, 499 FMUL_R,
492 FMUL_IMM, 500 FMUL_IMM,
@@ -686,6 +694,7 @@ private:
686 INST("0100110001011---", Id::FADD_C, Type::Arithmetic, "FADD_C"), 694 INST("0100110001011---", Id::FADD_C, Type::Arithmetic, "FADD_C"),
687 INST("0101110001011---", Id::FADD_R, Type::Arithmetic, "FADD_R"), 695 INST("0101110001011---", Id::FADD_R, Type::Arithmetic, "FADD_R"),
688 INST("0011100-01011---", Id::FADD_IMM, Type::Arithmetic, "FADD_IMM"), 696 INST("0011100-01011---", Id::FADD_IMM, Type::Arithmetic, "FADD_IMM"),
697 INST("000010----------", Id::FADD32I, Type::ArithmeticImmediate, "FADD32I"),
689 INST("0100110001101---", Id::FMUL_C, Type::Arithmetic, "FMUL_C"), 698 INST("0100110001101---", Id::FMUL_C, Type::Arithmetic, "FMUL_C"),
690 INST("0101110001101---", Id::FMUL_R, Type::Arithmetic, "FMUL_R"), 699 INST("0101110001101---", Id::FMUL_R, Type::Arithmetic, "FMUL_R"),
691 INST("0011100-01101---", Id::FMUL_IMM, Type::Arithmetic, "FMUL_IMM"), 700 INST("0011100-01101---", Id::FMUL_IMM, Type::Arithmetic, "FMUL_IMM"),
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:
968 regs.GetRegisterAsFloat(instr.gpr8) + " * " + GetImmediate32(instr), 1, 1); 968 regs.GetRegisterAsFloat(instr.gpr8) + " * " + GetImmediate32(instr), 1, 1);
969 break; 969 break;
970 } 970 }
971 case OpCode::Id::FADD32I: {
972 std::string op_a = regs.GetRegisterAsFloat(instr.gpr8);
973 std::string op_b = GetImmediate32(instr);
974
975 if (instr.fadd32i.abs_a) {
976 op_a = "abs(" + op_a + ')';
977 }
978
979 if (instr.fadd32i.negate_a) {
980 op_a = "-(" + op_a + ')';
981 }
982
983 if (instr.fadd32i.abs_b) {
984 op_b = "abs(" + op_b + ')';
985 }
986
987 if (instr.fadd32i.negate_b) {
988 op_b = "-(" + op_b + ')';
989 }
990
991 regs.SetRegisterToFloat(instr.gpr0, 0, op_a + " + " + op_b, 1, 1);
992 break;
993 }
971 } 994 }
972 break; 995 break;
973 } 996 }