summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-08-24 02:10:11 -0300
committerGravatar Yuri Kunde Schlesner2015-08-24 02:10:11 -0300
commiteff10959de41027da7a09298941fcb403f610192 (patch)
tree8ad6f1edf2cc992cbc820b6028f052498a5408d8 /src
parentShader JIT: Tiny micro-optimization in DPH (diff)
downloadyuzu-eff10959de41027da7a09298941fcb403f610192.tar.gz
yuzu-eff10959de41027da7a09298941fcb403f610192.tar.xz
yuzu-eff10959de41027da7a09298941fcb403f610192.zip
fixup! Shaders: Fix multiplications between 0.0 and inf
Diffstat (limited to 'src')
-rw-r--r--src/video_core/pica.h8
1 files 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 {
1031 } 1031 }
1032 1032
1033 float24 operator * (const float24& flt) const { 1033 float24 operator * (const float24& flt) const {
1034 if ((this->value == 0.f && flt.value == flt.value) || 1034 if ((this->value == 0.f && !std::isnan(flt.value)) ||
1035 (flt.value == 0.f && this->value == this->value)) 1035 (flt.value == 0.f && !std::isnan(this->value)))
1036 // PICA gives 0 instead of NaN when multiplying by inf 1036 // PICA gives 0 instead of NaN when multiplying by inf
1037 return Zero(); 1037 return Zero();
1038 return float24::FromFloat32(ToFloat32() * flt.ToFloat32()); 1038 return float24::FromFloat32(ToFloat32() * flt.ToFloat32());
@@ -1051,8 +1051,8 @@ struct float24 {
1051 } 1051 }
1052 1052
1053 float24& operator *= (const float24& flt) { 1053 float24& operator *= (const float24& flt) {
1054 if ((this->value == 0.f && flt.value == flt.value) || 1054 if ((this->value == 0.f && !std::isnan(flt.value)) ||
1055 (flt.value == 0.f && this->value == this->value)) 1055 (flt.value == 0.f && !std::isnan(this->value)))
1056 // PICA gives 0 instead of NaN when multiplying by inf 1056 // PICA gives 0 instead of NaN when multiplying by inf
1057 *this = Zero(); 1057 *this = Zero();
1058 else value *= flt.ToFloat32(); 1058 else value *= flt.ToFloat32();