diff options
| author | Léo Lam <leo@leolam.fr> | 2021-08-04 03:08:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-04 03:08:34 +0200 |
| commit | c9c5f7a89c3f9a678d893560c906f00263ceb9de (patch) | |
| tree | 052eb85dcbfa9c17c60124c56574a90fd425ab95 /Source/Core/VideoBackends/Software/TransformUnit.cpp | |
| parent | 45cddda3bca164af6435e5b8bf1418a2fa391a26 (diff) | |
| parent | 3a4d8379bf16e61348dafc1750a8e4b65394f7a9 (diff) | |
Merge pull request #9928 from Pokechu22/shadow-the-hedgehog-eyelids-NaN
Convert NaN to 1 when generating texture coordinates
Diffstat (limited to 'Source/Core/VideoBackends/Software/TransformUnit.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/TransformUnit.cpp | 9 |
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]; |
