summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2018-04-29 15:59:33 -0400
committerGravatar GitHub2018-04-29 15:59:33 -0400
commit869075867bf7bda1323ee2bb32ec45a89dfdb0ca (patch)
tree6a0c7db0c07e9b1cc919c1bd017451be5354d2b1
parentMerge pull request #416 from bunnei/shader-ints-p3 (diff)
parentShaders: Implemented predicate condition 3 (LessEqual) in the fset and fsetp ... (diff)
downloadyuzu-869075867bf7bda1323ee2bb32ec45a89dfdb0ca.tar.gz
yuzu-869075867bf7bda1323ee2bb32ec45a89dfdb0ca.tar.xz
yuzu-869075867bf7bda1323ee2bb32ec45a89dfdb0ca.zip
Merge pull request #421 from Subv/sh_pred3
Shaders: Implemented predicate condition 3 (LessEqual) in the fset and fsetp instructions.
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 27190cc45..96d39c5c7 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -882,6 +882,9 @@ private:
882 case PredCondition::Equal: 882 case PredCondition::Equal:
883 SetPredicate(instr.fsetp.pred3, '(' + op_a + ") == (" + op_b + ')'); 883 SetPredicate(instr.fsetp.pred3, '(' + op_a + ") == (" + op_b + ')');
884 break; 884 break;
885 case PredCondition::LessEqual:
886 SetPredicate(instr.fsetp.pred3, '(' + op_a + ") <= (" + op_b + ')');
887 break;
885 default: 888 default:
886 NGLOG_CRITICAL(HW_GPU, "Unhandled predicate condition: {} (a: {}, b: {})", 889 NGLOG_CRITICAL(HW_GPU, "Unhandled predicate condition: {} (a: {}, b: {})",
887 static_cast<unsigned>(instr.fsetp.cond.Value()), op_a, op_b); 890 static_cast<unsigned>(instr.fsetp.cond.Value()), op_a, op_b);
@@ -933,6 +936,10 @@ private:
933 regs.SetRegisterToFloat(instr.gpr0, 0, 936 regs.SetRegisterToFloat(instr.gpr0, 0,
934 "((" + op_a + ") == (" + op_b + ")) ? 1.0 : 0", 1, 1); 937 "((" + op_a + ") == (" + op_b + ")) ? 1.0 : 0", 1, 1);
935 break; 938 break;
939 case PredCondition::LessEqual:
940 regs.SetRegisterToFloat(instr.gpr0, 0,
941 "((" + op_a + ") <= (" + op_b + ")) ? 1.0 : 0", 1, 1);
942 break;
936 case PredCondition::GreaterThan: 943 case PredCondition::GreaterThan:
937 regs.SetRegisterToFloat(instr.gpr0, 0, 944 regs.SetRegisterToFloat(instr.gpr0, 0,
938 "((" + op_a + ") > (" + op_b + ")) ? 1.0 : 0", 1, 1); 945 "((" + op_a + ") > (" + op_b + ")) ? 1.0 : 0", 1, 1);