yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

Merge pull request #1100 from ogniK5377/missing-pred

Added pred-condition GreaterThanWithNan
This commit is contained in:
bunnei 2018-08-18 10:32:59 -04:00 committed by GitHub
commit 6eba539f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -141,6 +141,7 @@ enum class PredCondition : u64 {
NotEqual = 5, NotEqual = 5,
GreaterEqual = 6, GreaterEqual = 6,
LessThanWithNan = 9, LessThanWithNan = 9,
GreaterThanWithNan = 12,
NotEqualWithNan = 13, NotEqualWithNan = 13,
// TODO(Subv): Other condition types // TODO(Subv): Other condition types
}; };

View File

@ -703,10 +703,11 @@ private:
const std::string& op_a, const std::string& op_b) const { const std::string& op_a, const std::string& op_b) const {
using Tegra::Shader::PredCondition; using Tegra::Shader::PredCondition;
static const std::unordered_map<PredCondition, const char*> PredicateComparisonStrings = { static const std::unordered_map<PredCondition, const char*> PredicateComparisonStrings = {
{PredCondition::LessThan, "<"}, {PredCondition::Equal, "=="}, {PredCondition::LessThan, "<"}, {PredCondition::Equal, "=="},
{PredCondition::LessEqual, "<="}, {PredCondition::GreaterThan, ">"}, {PredCondition::LessEqual, "<="}, {PredCondition::GreaterThan, ">"},
{PredCondition::NotEqual, "!="}, {PredCondition::GreaterEqual, ">="}, {PredCondition::NotEqual, "!="}, {PredCondition::GreaterEqual, ">="},
{PredCondition::LessThanWithNan, "<"}, {PredCondition::NotEqualWithNan, "!="}, {PredCondition::LessThanWithNan, "<"}, {PredCondition::NotEqualWithNan, "!="},
{PredCondition::GreaterThanWithNan, ">"},
}; };
const auto& comparison{PredicateComparisonStrings.find(condition)}; const auto& comparison{PredicateComparisonStrings.find(condition)};
@ -715,7 +716,8 @@ private:
std::string predicate{'(' + op_a + ") " + comparison->second + " (" + op_b + ')'}; std::string predicate{'(' + op_a + ") " + comparison->second + " (" + op_b + ')'};
if (condition == PredCondition::LessThanWithNan || if (condition == PredCondition::LessThanWithNan ||
condition == PredCondition::NotEqualWithNan) { condition == PredCondition::NotEqualWithNan ||
condition == PredCondition::GreaterThanWithNan) {
predicate += " || isnan(" + op_a + ") || isnan(" + op_b + ')'; predicate += " || isnan(" + op_a + ") || isnan(" + op_b + ')';
} }