diff options
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index ab978c2e2..77c465694 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -142,6 +142,7 @@ enum class PredCondition : u64 { | |||
| 142 | GreaterThan = 4, | 142 | GreaterThan = 4, |
| 143 | NotEqual = 5, | 143 | NotEqual = 5, |
| 144 | GreaterEqual = 6, | 144 | GreaterEqual = 6, |
| 145 | LessThanWithNan = 9, | ||
| 145 | NotEqualWithNan = 13, | 146 | NotEqualWithNan = 13, |
| 146 | // TODO(Subv): Other condition types | 147 | // TODO(Subv): Other condition types |
| 147 | }; | 148 | }; |
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index c29cabb84..c1efca23b 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -728,10 +728,10 @@ private: | |||
| 728 | const std::string& op_a, const std::string& op_b) const { | 728 | const std::string& op_a, const std::string& op_b) const { |
| 729 | using Tegra::Shader::PredCondition; | 729 | using Tegra::Shader::PredCondition; |
| 730 | static const std::unordered_map<PredCondition, const char*> PredicateComparisonStrings = { | 730 | static const std::unordered_map<PredCondition, const char*> PredicateComparisonStrings = { |
| 731 | {PredCondition::LessThan, "<"}, {PredCondition::Equal, "=="}, | 731 | {PredCondition::LessThan, "<"}, {PredCondition::Equal, "=="}, |
| 732 | {PredCondition::LessEqual, "<="}, {PredCondition::GreaterThan, ">"}, | 732 | {PredCondition::LessEqual, "<="}, {PredCondition::GreaterThan, ">"}, |
| 733 | {PredCondition::NotEqual, "!="}, {PredCondition::GreaterEqual, ">="}, | 733 | {PredCondition::NotEqual, "!="}, {PredCondition::GreaterEqual, ">="}, |
| 734 | {PredCondition::NotEqualWithNan, "!="}, | 734 | {PredCondition::LessThanWithNan, "<"}, {PredCondition::NotEqualWithNan, "!="}, |
| 735 | }; | 735 | }; |
| 736 | 736 | ||
| 737 | const auto& comparison{PredicateComparisonStrings.find(condition)}; | 737 | const auto& comparison{PredicateComparisonStrings.find(condition)}; |
| @@ -739,7 +739,8 @@ private: | |||
| 739 | "Unknown predicate comparison operation"); | 739 | "Unknown predicate comparison operation"); |
| 740 | 740 | ||
| 741 | std::string predicate{'(' + op_a + ") " + comparison->second + " (" + op_b + ')'}; | 741 | std::string predicate{'(' + op_a + ") " + comparison->second + " (" + op_b + ')'}; |
| 742 | if (condition == PredCondition::NotEqualWithNan) { | 742 | if (condition == PredCondition::LessThanWithNan || |
| 743 | condition == PredCondition::NotEqualWithNan) { | ||
| 743 | predicate += " || isnan(" + op_a + ") || isnan(" + op_b + ')'; | 744 | predicate += " || isnan(" + op_a + ") || isnan(" + op_b + ')'; |
| 744 | } | 745 | } |
| 745 | 746 | ||