summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 3b70efeec..b42913121 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -284,6 +284,13 @@ union Instruction {
284 } iadd32i; 284 } iadd32i;
285 285
286 union { 286 union {
287 BitField<53, 1, u64> negate_b;
288 BitField<54, 1, u64> abs_a;
289 BitField<56, 1, u64> negate_a;
290 BitField<57, 1, u64> abs_b;
291 } fadd32i;
292
293 union {
287 BitField<20, 8, u64> shift_position; 294 BitField<20, 8, u64> shift_position;
288 BitField<28, 8, u64> shift_length; 295 BitField<28, 8, u64> shift_length;
289 BitField<48, 1, u64> negate_b; 296 BitField<48, 1, u64> negate_b;
@@ -473,6 +480,7 @@ public:
473 FADD_C, 480 FADD_C,
474 FADD_R, 481 FADD_R,
475 FADD_IMM, 482 FADD_IMM,
483 FADD32I,
476 FMUL_C, 484 FMUL_C,
477 FMUL_R, 485 FMUL_R,
478 FMUL_IMM, 486 FMUL_IMM,
@@ -672,6 +680,7 @@ private:
672 INST("0100110001011---", Id::FADD_C, Type::Arithmetic, "FADD_C"), 680 INST("0100110001011---", Id::FADD_C, Type::Arithmetic, "FADD_C"),
673 INST("0101110001011---", Id::FADD_R, Type::Arithmetic, "FADD_R"), 681 INST("0101110001011---", Id::FADD_R, Type::Arithmetic, "FADD_R"),
674 INST("0011100-01011---", Id::FADD_IMM, Type::Arithmetic, "FADD_IMM"), 682 INST("0011100-01011---", Id::FADD_IMM, Type::Arithmetic, "FADD_IMM"),
683 INST("000010----------", Id::FADD32I, Type::ArithmeticImmediate, "FADD32I"),
675 INST("0100110001101---", Id::FMUL_C, Type::Arithmetic, "FMUL_C"), 684 INST("0100110001101---", Id::FMUL_C, Type::Arithmetic, "FMUL_C"),
676 INST("0101110001101---", Id::FMUL_R, Type::Arithmetic, "FMUL_R"), 685 INST("0101110001101---", Id::FMUL_R, Type::Arithmetic, "FMUL_R"),
677 INST("0011100-01101---", Id::FMUL_IMM, Type::Arithmetic, "FMUL_IMM"), 686 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 e817aca5a..c5d27ec80 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 }