summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-02-04 21:14:13 +0100
committerGitHub <noreply@github.com>2020-02-04 21:14:13 +0100
commit08c508b1c4740df6c1dca618c857efc4ced14afe (patch)
tree10475ad92628d80b220f37253d9a40fd505bcfe5 /src
parentMerge pull request #3356 from ReinUsesLisp/fcmp (diff)
parentshader/bfi: Implement register-constant buffer variant (diff)
downloadyuzu-08c508b1c4740df6c1dca618c857efc4ced14afe.tar
yuzu-08c508b1c4740df6c1dca618c857efc4ced14afe.tar.gz
yuzu-08c508b1c4740df6c1dca618c857efc4ced14afe.tar.bz2
yuzu-08c508b1c4740df6c1dca618c857efc4ced14afe.tar.lz
yuzu-08c508b1c4740df6c1dca618c857efc4ced14afe.tar.xz
yuzu-08c508b1c4740df6c1dca618c857efc4ced14afe.tar.zst
yuzu-08c508b1c4740df6c1dca618c857efc4ced14afe.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/shader_bytecode.h2
-rw-r--r--src/video_core/shader/decode/bfi.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index cbb201114..81b6d9eff 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -1708,6 +1708,7 @@ public:
BFE_C,
BFE_R,
BFE_IMM,
+ BFI_RC,
BFI_IMM_R,
BRA,
BRX,
@@ -2135,6 +2136,7 @@ private:
INST("0100110000000---", Id::BFE_C, Type::Bfe, "BFE_C"),
INST("0101110000000---", Id::BFE_R, Type::Bfe, "BFE_R"),
INST("0011100-00000---", Id::BFE_IMM, Type::Bfe, "BFE_IMM"),
+ INST("0101001111110---", Id::BFI_RC, Type::Bfi, "BFI_RC"),
INST("0011011-11110---", Id::BFI_IMM_R, Type::Bfi, "BFI_IMM_R"),
INST("0100110001000---", Id::LOP_C, Type::ArithmeticInteger, "LOP_C"),
INST("0101110001000---", Id::LOP_R, Type::ArithmeticInteger, "LOP_R"),
diff --git a/src/video_core/shader/decode/bfi.cpp b/src/video_core/shader/decode/bfi.cpp
index 8be1119df..f992bbe2a 100644
--- a/src/video_core/shader/decode/bfi.cpp
+++ b/src/video_core/shader/decode/bfi.cpp
@@ -17,10 +17,13 @@ u32 ShaderIR::DecodeBfi(NodeBlock& bb, u32 pc) {
const Instruction instr = {program_code[pc]};
const auto opcode = OpCode::Decode(instr);
- const auto [base, packed_shift] = [&]() -> std::tuple<Node, Node> {
+ const auto [packed_shift, base] = [&]() -> std::pair<Node, Node> {
switch (opcode->get().GetId()) {
+ case OpCode::Id::BFI_RC:
+ return {GetRegister(instr.gpr39),
+ GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset)};
case OpCode::Id::BFI_IMM_R:
- return {GetRegister(instr.gpr39), Immediate(instr.alu.GetSignedImm20_20())};
+ return {Immediate(instr.alu.GetSignedImm20_20()), GetRegister(instr.gpr39)};
default:
UNREACHABLE();
return {Immediate(0), Immediate(0)};