summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/decode/hfma2.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-04-16 00:48:11 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-04-16 02:16:10 +0200
commitf43995ec535042d24fa1af637642a2974bfa4773 (patch)
tree9b5526da635742d96d7e3d95d6fd2e95dd5b1399 /src/video_core/shader/decode/hfma2.cpp
parentgl_shader_decompiler: Fix MrgH0 decompilation (diff)
downloadyuzu-f43995ec535042d24fa1af637642a2974bfa4773.tar
yuzu-f43995ec535042d24fa1af637642a2974bfa4773.tar.gz
yuzu-f43995ec535042d24fa1af637642a2974bfa4773.tar.bz2
yuzu-f43995ec535042d24fa1af637642a2974bfa4773.tar.lz
yuzu-f43995ec535042d24fa1af637642a2974bfa4773.tar.xz
yuzu-f43995ec535042d24fa1af637642a2974bfa4773.tar.zst
yuzu-f43995ec535042d24fa1af637642a2974bfa4773.zip
Diffstat (limited to 'src/video_core/shader/decode/hfma2.cpp')
-rw-r--r--src/video_core/shader/decode/hfma2.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/video_core/shader/decode/hfma2.cpp b/src/video_core/shader/decode/hfma2.cpp
index 7a07c5ec6..5c1becce5 100644
--- a/src/video_core/shader/decode/hfma2.cpp
+++ b/src/video_core/shader/decode/hfma2.cpp
@@ -27,10 +27,6 @@ u32 ShaderIR::DecodeHfma2(NodeBlock& bb, u32 pc) {
}
constexpr auto identity = HalfType::H0_H1;
-
- const HalfType type_a = instr.hfma2.type_a;
- const Node op_a = GetRegister(instr.gpr8);
-
bool neg_b{}, neg_c{};
auto [saturate, type_b, op_b, type_c,
op_c] = [&]() -> std::tuple<bool, HalfType, Node, HalfType, Node> {
@@ -62,11 +58,11 @@ u32 ShaderIR::DecodeHfma2(NodeBlock& bb, u32 pc) {
}();
UNIMPLEMENTED_IF_MSG(saturate, "HFMA2 saturation is not implemented");
- op_b = GetOperandAbsNegHalf(op_b, false, neg_b);
- op_c = GetOperandAbsNegHalf(op_c, false, neg_c);
+ const Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.hfma2.type_a);
+ op_b = GetOperandAbsNegHalf(UnpackHalfFloat(op_b, type_b), false, neg_b);
+ op_c = GetOperandAbsNegHalf(UnpackHalfFloat(op_c, type_c), false, neg_c);
- MetaHalfArithmetic meta{true, {type_a, type_b, type_c}};
- Node value = Operation(OperationCode::HFma, meta, op_a, op_b, op_c);
+ Node value = Operation(OperationCode::HFma, PRECISE, op_a, op_b, op_c);
value = HalfMerge(GetRegister(instr.gpr0), value, instr.hfma2.merge);
SetRegister(bb, instr.gpr0, value);