summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/shader_bytecode.h3
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp20
2 files changed, 23 insertions, 0 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 83a6fd875..613fdc823 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -1256,6 +1256,7 @@ public:
1256 BFE_C, 1256 BFE_C,
1257 BFE_R, 1257 BFE_R,
1258 BFE_IMM, 1258 BFE_IMM,
1259 BFI_IMM_R,
1259 BRA, 1260 BRA,
1260 PBK, 1261 PBK,
1261 LD_A, 1262 LD_A,
@@ -1396,6 +1397,7 @@ public:
1396 ArithmeticHalf, 1397 ArithmeticHalf,
1397 ArithmeticHalfImmediate, 1398 ArithmeticHalfImmediate,
1398 Bfe, 1399 Bfe,
1400 Bfi,
1399 Shift, 1401 Shift,
1400 Ffma, 1402 Ffma,
1401 Hfma2, 1403 Hfma2,
@@ -1613,6 +1615,7 @@ private:
1613 INST("0100110000000---", Id::BFE_C, Type::Bfe, "BFE_C"), 1615 INST("0100110000000---", Id::BFE_C, Type::Bfe, "BFE_C"),
1614 INST("0101110000000---", Id::BFE_R, Type::Bfe, "BFE_R"), 1616 INST("0101110000000---", Id::BFE_R, Type::Bfe, "BFE_R"),
1615 INST("0011100-00000---", Id::BFE_IMM, Type::Bfe, "BFE_IMM"), 1617 INST("0011100-00000---", Id::BFE_IMM, Type::Bfe, "BFE_IMM"),
1618 INST("0011011-11110---", Id::BFI_IMM_R, Type::Bfi, "BFI_IMM_R"),
1616 INST("0100110001000---", Id::LOP_C, Type::ArithmeticInteger, "LOP_C"), 1619 INST("0100110001000---", Id::LOP_C, Type::ArithmeticInteger, "LOP_C"),
1617 INST("0101110001000---", Id::LOP_R, Type::ArithmeticInteger, "LOP_R"), 1620 INST("0101110001000---", Id::LOP_R, Type::ArithmeticInteger, "LOP_R"),
1618 INST("0011100001000---", Id::LOP_IMM, Type::ArithmeticInteger, "LOP_IMM"), 1621 INST("0011100001000---", Id::LOP_IMM, Type::ArithmeticInteger, "LOP_IMM"),
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 5fde22ad4..4c662eedb 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1700,6 +1700,26 @@ private:
1700 1700
1701 break; 1701 break;
1702 } 1702 }
1703 case OpCode::Type::Bfi: {
1704 UNIMPLEMENTED_IF(instr.generates_cc);
1705
1706 const auto [base, packed_shift] = [&]() -> std::tuple<std::string, std::string> {
1707 switch (opcode->get().GetId()) {
1708 case OpCode::Id::BFI_IMM_R:
1709 return {regs.GetRegisterAsInteger(instr.gpr39, 0, false),
1710 std::to_string(instr.alu.GetSignedImm20_20())};
1711 default:
1712 UNREACHABLE();
1713 }
1714 }();
1715 const std::string offset = '(' + packed_shift + " & 0xff)";
1716 const std::string bits = "((" + packed_shift + " >> 8) & 0xff)";
1717 const std::string insert = regs.GetRegisterAsInteger(instr.gpr8, 0, false);
1718 regs.SetRegisterToInteger(
1719 instr.gpr0, false, 0,
1720 "bitfieldInsert(" + base + ", " + insert + ", " + offset + ", " + bits + ')', 1, 1);
1721 break;
1722 }
1703 case OpCode::Type::Shift: { 1723 case OpCode::Type::Shift: {
1704 std::string op_a = regs.GetRegisterAsInteger(instr.gpr8, 0, true); 1724 std::string op_a = regs.GetRegisterAsInteger(instr.gpr8, 0, true);
1705 std::string op_b; 1725 std::string op_b;