1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-20 12:36:05 +08:00

More mathlib unification with SDK 2013, including 3dnow fixes (#231)

This commit is contained in:
Nick Hastings
2024-04-21 11:52:42 -04:00
parent b886c90f88
commit 732b5b29b5
19 changed files with 328 additions and 29 deletions

View File

@ -26,6 +26,9 @@
#include "mathlib/vector.h"
#if !defined( _X360 )
#include "mathlib/amd3dx.h"
#ifndef OSX
#include "3dnow.h"
#endif
#include "sse.h"
#endif
@ -3355,7 +3358,26 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright
s_bMMXEnabled = false;
}
s_b3DNowEnabled = false;
// SSE Generally performs better than 3DNow when present, so this is placed
// first to allow SSE to override these settings.
#if !defined( OSX ) && !defined( PLATFORM_WINDOWS_PC64 ) && !defined(LINUX)
if ( bAllow3DNow && pi.m_b3DNow )
{
s_b3DNowEnabled = true;
// Select the 3DNow specific routines if available;
pfVectorNormalize = _3DNow_VectorNormalize;
pfVectorNormalizeFast = _3DNow_VectorNormalizeFast;
pfInvRSquared = _3DNow_InvRSquared;
pfSqrt = _3DNow_Sqrt;
pfRSqrt = _3DNow_RSqrt;
pfRSqrtFast = _3DNow_RSqrt;
}
else
#endif
{
s_b3DNowEnabled = false;
}
if ( bAllowSSE && pi.m_bSSE )
{