From eff10959de41027da7a09298941fcb403f610192 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Mon, 24 Aug 2015 02:10:11 -0300 Subject: [PATCH] fixup! Shaders: Fix multiplications between 0.0 and inf --- src/video_core/pica.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video_core/pica.h b/src/video_core/pica.h index cf148de50..bb689f2a9 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -1031,8 +1031,8 @@ struct float24 { } float24 operator * (const float24& flt) const { - if ((this->value == 0.f && flt.value == flt.value) || - (flt.value == 0.f && this->value == this->value)) + if ((this->value == 0.f && !std::isnan(flt.value)) || + (flt.value == 0.f && !std::isnan(this->value))) // PICA gives 0 instead of NaN when multiplying by inf return Zero(); return float24::FromFloat32(ToFloat32() * flt.ToFloat32()); @@ -1051,8 +1051,8 @@ struct float24 { } float24& operator *= (const float24& flt) { - if ((this->value == 0.f && flt.value == flt.value) || - (flt.value == 0.f && this->value == this->value)) + if ((this->value == 0.f && !std::isnan(flt.value)) || + (flt.value == 0.f && !std::isnan(this->value))) // PICA gives 0 instead of NaN when multiplying by inf *this = Zero(); else value *= flt.ToFloat32();