mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 09:07:58 -05:00
Shaders: Explicitly conform to PICA semantics in MAX/MIN
This commit is contained in:
@ -177,7 +177,10 @@ void RunInterpreter(UnitState<Debug>& state) {
|
||||
if (!swizzle.DestComponentEnabled(i))
|
||||
continue;
|
||||
|
||||
dest[i] = std::max(src1[i], src2[i]);
|
||||
// NOTE: Exact form required to match NaN semantics to hardware:
|
||||
// max(0, NaN) -> NaN
|
||||
// max(NaN, 0) -> 0
|
||||
dest[i] = (src1[i] > src2[i]) ? src1[i] : src2[i];
|
||||
}
|
||||
Record<DebugDataRecord::DEST_OUT>(state.debug, iteration, dest);
|
||||
break;
|
||||
@ -190,7 +193,10 @@ void RunInterpreter(UnitState<Debug>& state) {
|
||||
if (!swizzle.DestComponentEnabled(i))
|
||||
continue;
|
||||
|
||||
dest[i] = std::min(src1[i], src2[i]);
|
||||
// NOTE: Exact form required to match NaN semantics to hardware:
|
||||
// min(0, NaN) -> NaN
|
||||
// min(NaN, 0) -> 0
|
||||
dest[i] = (src1[i] < src2[i]) ? src1[i] : src2[i];
|
||||
}
|
||||
Record<DebugDataRecord::DEST_OUT>(state.debug, iteration, dest);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user