diff --git a/Source/Engine/Core/Math/Half.h b/Source/Engine/Core/Math/Half.h index 634c31ab8..842ec2bde 100644 --- a/Source/Engine/Core/Math/Half.h +++ b/Source/Engine/Core/Math/Half.h @@ -6,13 +6,23 @@ #include "Vector2.h" #include "Vector3.h" +#if PLATFORM_SIMD_AVX +// MSVC generates slower code without AVX +#define USE_SSE_HALF_CONVERSION 1 +#else +#define USE_SSE_HALF_CONVERSION 0 +#endif + +#if USE_SSE_HALF_CONVERSION +#include +#include +#endif + /// /// Half-precision 16 bit floating point number consisting of a sign bit, a 5 bit biased exponent, and a 10 bit mantissa /// typedef uint16 Half; -#define USE_SSE_HALF_CONVERSION 0 - /// /// Utility for packing/unpacking floating point value from single precision (32 bit) to half precision (16 bit). ///