summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/TransformUnit.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2021-07-20 19:00:29 -0700
committerPokechu22 <Pokechu022@gmail.com>2021-07-24 22:20:35 -0700
commit3a4d8379bf16e61348dafc1750a8e4b65394f7a9 (patch)
tree02fe5ac7022b78e202c205a1b77f39de52275cc1 /Source/Core/VideoBackends/Software/TransformUnit.cpp
parent55a465c6e6152656e3ca54be3c53e8072ccf5653 (diff)
Convert NaN to 1 when generating texture coordinates
This fixes eyelids in Shadow the Hedgehog during cutscenes (https://bugs.dolphin-emu.org/issues/11458)
Diffstat (limited to 'Source/Core/VideoBackends/Software/TransformUnit.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/TransformUnit.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp
index 71d33f33ed..bf56307025 100644
--- a/Source/Core/VideoBackends/Software/TransformUnit.cpp
+++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp
@@ -137,6 +137,15 @@ static void TransformTexCoordRegular(const TexMtxInfo& texinfo, int coordNum,
}
}
+ // Convert NaNs to 1 - needed to fix eyelids in Shadow the Hedgehog during cutscenes
+ // See https://bugs.dolphin-emu.org/issues/11458
+ if (std::isnan(src.x))
+ src.x = 1;
+ if (std::isnan(src.y))
+ src.y = 1;
+ if (std::isnan(src.z))
+ src.z = 1;
+
const float* mat = &xfmem.posMatrices[srcVertex->texMtx[coordNum] * 4];
Vec3* dst = &dstVertex->texCoords[coordNum];