Skip to content

Commit

Permalink
Merge pull request #16110 from unknownbrackets/sse4-normalize
Browse files Browse the repository at this point in the history
GPU: Fix SSE4 Vec3f normalize
  • Loading branch information
hrydgard committed Sep 26, 2022
2 parents 391320d + c80f325 commit 9709984
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion GPU/Math3D.cpp
Expand Up @@ -121,7 +121,8 @@ __m128 SSENormalizeMultiplierSSE2(__m128 v)
#endif
__m128 SSENormalizeMultiplierSSE4(__m128 v)
{
return _mm_rsqrt_ps(_mm_dp_ps(v, v, 0xFF));
// This is only used for Vec3f, so ignore the 4th component, might be garbage.
return _mm_rsqrt_ps(_mm_dp_ps(v, v, 0x77));
}

__m128 SSENormalizeMultiplier(bool useSSE4, __m128 v)
Expand Down

0 comments on commit 9709984

Please sign in to comment.