summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David Marcec2018-08-18 17:49:59 +1000
committerGravatar David Marcec2018-08-18 17:49:59 +1000
commit63dff47e2269107233e0fb4956d0fcdbf6566a7e (patch)
tree6c827c5f2f64f426d21d811116de61cbbdb7038b /src
parentMerge pull request #1096 from bunnei/supported-blits (diff)
downloadyuzu-63dff47e2269107233e0fb4956d0fcdbf6566a7e.tar.gz
yuzu-63dff47e2269107233e0fb4956d0fcdbf6566a7e.tar.xz
yuzu-63dff47e2269107233e0fb4956d0fcdbf6566a7e.zip
Added predcondition GreaterThanWithNan
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/shader_bytecode.h1
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp12
2 files changed, 8 insertions, 5 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 2526ebf28..b038a9d92 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -141,6 +141,7 @@ enum class PredCondition : u64 {
141 NotEqual = 5, 141 NotEqual = 5,
142 GreaterEqual = 6, 142 GreaterEqual = 6,
143 LessThanWithNan = 9, 143 LessThanWithNan = 9,
144 GreaterThanWithNan = 12,
144 NotEqualWithNan = 13, 145 NotEqualWithNan = 13,
145 // TODO(Subv): Other condition types 146 // TODO(Subv): Other condition types
146}; 147};
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 07006b55e..bb01b3c27 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -703,10 +703,11 @@ private:
703 const std::string& op_a, const std::string& op_b) const { 703 const std::string& op_a, const std::string& op_b) const {
704 using Tegra::Shader::PredCondition; 704 using Tegra::Shader::PredCondition;
705 static const std::unordered_map<PredCondition, const char*> PredicateComparisonStrings = { 705 static const std::unordered_map<PredCondition, const char*> PredicateComparisonStrings = {
706 {PredCondition::LessThan, "<"}, {PredCondition::Equal, "=="}, 706 {PredCondition::LessThan, "<"}, {PredCondition::Equal, "=="},
707 {PredCondition::LessEqual, "<="}, {PredCondition::GreaterThan, ">"}, 707 {PredCondition::LessEqual, "<="}, {PredCondition::GreaterThan, ">"},
708 {PredCondition::NotEqual, "!="}, {PredCondition::GreaterEqual, ">="}, 708 {PredCondition::NotEqual, "!="}, {PredCondition::GreaterEqual, ">="},
709 {PredCondition::LessThanWithNan, "<"}, {PredCondition::NotEqualWithNan, "!="}, 709 {PredCondition::LessThanWithNan, "<"}, {PredCondition::NotEqualWithNan, "!="},
710 {PredCondition::GreaterThanWithNan, ">"},
710 }; 711 };
711 712
712 const auto& comparison{PredicateComparisonStrings.find(condition)}; 713 const auto& comparison{PredicateComparisonStrings.find(condition)};
@@ -715,7 +716,8 @@ private:
715 716
716 std::string predicate{'(' + op_a + ") " + comparison->second + " (" + op_b + ')'}; 717 std::string predicate{'(' + op_a + ") " + comparison->second + " (" + op_b + ')'};
717 if (condition == PredCondition::LessThanWithNan || 718 if (condition == PredCondition::LessThanWithNan ||
718 condition == PredCondition::NotEqualWithNan) { 719 condition == PredCondition::NotEqualWithNan ||
720 condition == PredCondition::GreaterThanWithNan) {
719 predicate += " || isnan(" + op_a + ") || isnan(" + op_b + ')'; 721 predicate += " || isnan(" + op_a + ") || isnan(" + op_b + ')';
720 } 722 }
721 723