mirror of
https://github.com/PabloMK7/citra.git
synced 2024-11-30 19:30:17 +00:00
gl_shader_decompiler: Fix min/max NaN edge case (#6935)
This commit is contained in:
parent
5ad58e0605
commit
cab0ad50f0
1 changed files with 12 additions and 2 deletions
|
@ -476,12 +476,22 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
case OpCode::Id::MAX: {
|
case OpCode::Id::MAX: {
|
||||||
SetDest(swizzle, dest_reg, fmt::format("max({}, {})", src1, src2), 4, 4);
|
if (sanitize_mul) {
|
||||||
|
SetDest(swizzle, dest_reg,
|
||||||
|
fmt::format("mix({1}, {0}, greaterThan({0}, {1}))", src1, src2), 4, 4);
|
||||||
|
} else {
|
||||||
|
SetDest(swizzle, dest_reg, fmt::format("max({}, {})", src1, src2), 4, 4);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case OpCode::Id::MIN: {
|
case OpCode::Id::MIN: {
|
||||||
SetDest(swizzle, dest_reg, fmt::format("min({}, {})", src1, src2), 4, 4);
|
if (sanitize_mul) {
|
||||||
|
SetDest(swizzle, dest_reg,
|
||||||
|
fmt::format("mix({1}, {0}, lessThan({0}, {1}))", src1, src2), 4, 4);
|
||||||
|
} else {
|
||||||
|
SetDest(swizzle, dest_reg, fmt::format("min({}, {})", src1, src2), 4, 4);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue