Go to the documentation of this file.
33 #ifndef _AK_TOOLS_COMMON_AKPLATFORMFUNCS_H
34 #define _AK_TOOLS_COMMON_AKPLATFORMFUNCS_H
45 #elif defined (AK_XBOX)
46 #include <AK/Tools/XboxOne/AkPlatformFuncs.h>
48 #elif defined (AK_APPLE)
50 #include <AK/Tools/POSIX/AkPlatformFuncs.h>
52 #elif defined (AK_ANDROID)
55 #elif defined (AK_PS4)
58 #elif defined (AK_PS5)
61 #elif defined (AK_EMSCRIPTEN)
62 #include <AK/Tools/Emscripten/AkPlatformFuncs.h>
64 #elif defined (AK_LINUX)
67 #include <AK/Tools/GGP/AkPlatformFuncs.h>
70 #include <AK/Tools/POSIX/AkPlatformFuncs.h>
72 #elif defined (AK_QNX)
73 #include <AK/Tools/QNX/AkPlatformFuncs.h>
74 #include <AK/Tools/POSIX/AkPlatformFuncs.h>
80 #error AkPlatformFuncs.h: Undefined platform
83 #ifndef AkPrefetchZero
84 #define AkPrefetchZero(___Dest, ___Size)
87 #ifndef AkPrefetchZeroAligned
88 #define AkPrefetchZeroAligned(___Dest, ___Size)
91 #ifndef AkZeroMemAligned
92 #define AkZeroMemAligned(___Dest, ___Size) AKPLATFORM::AkMemSet(___Dest, 0, ___Size);
94 #ifndef AkZeroMemLarge
95 #define AkZeroMemLarge(___Dest, ___Size) AKPLATFORM::AkMemSet(___Dest, 0, ___Size);
97 #ifndef AkZeroMemSmall
98 #define AkZeroMemSmall(___Dest, ___Size) AKPLATFORM::AkMemSet(___Dest, 0, ___Size);
103 #if __has_builtin( __builtin_alloca_with_align )
104 #define AkAllocaSIMD( _size_ ) __builtin_alloca_with_align( _size_, 128 )
107 #define AkAllocaSIMD( _size_ ) (void*)( ( ( uintptr_t )AkAlloca( _size_ + 16 ) + 0xF ) & ~0xF )
110 #define AkAllocaSIMD( _size_ ) AkAlloca( _size_ )
114 #ifndef AK_THREAD_INIT_CODE
115 #define AK_THREAD_INIT_CODE(_threadProperties)
126 while( in_uWord ){ ++num; in_uWord &= in_uWord-1; }
135 in_uValue |= in_uValue >> 1;
136 in_uValue |= in_uValue >> 2;
137 in_uValue |= in_uValue >> 4;
138 in_uValue |= in_uValue >> 8;
139 in_uValue |= in_uValue >> 16;
146 return ( x << r ) | ( x >> ( 32 - r ) );
151 return ( x << r ) | ( x >> ( 64 - r ) );
165 #if defined _MSC_VER && defined AK_CPU_X86_64
168 unsigned long ret = 0;
169 _BitScanForward64(&ret, in_bits);
172 #elif __clang__ || defined __GNUG__
175 return __builtin_ctzll(in_bits);
180 unsigned long ret = 0;
183 while ((in_bits & 1ULL) == 0)
196 unsigned long ret = 0;
197 _BitScanForward(&ret, in_bits);
201 #elif __clang__ || defined __GNUG__
204 return __builtin_ctzl(in_bits);
209 unsigned long ret = 0;
212 while ((in_bits & 1ULL) == 0)
224 #ifndef AK_PERF_RECORDING_RESET
225 #define AK_PERF_RECORDING_RESET()
227 #ifndef AK_PERF_RECORDING_START
228 #define AK_PERF_RECORDING_START( __StorageName__, __uExecutionCountStart__, __uExecutionCountStop__ )
230 #ifndef AK_PERF_RECORDING_STOP
231 #define AK_PERF_RECORDING_STOP( __StorageName__, __uExecutionCountStart__, __uExecutionCountStop__ )
234 #ifndef AK_INSTRUMENT_BEGIN
235 #define AK_INSTRUMENT_BEGIN( _zone_name_ )
236 #define AK_INSTRUMENT_END( _zone_name_ )
237 #define AK_INSTRUMENT_SCOPE( _zone_name_ )
239 #define AK_INSTRUMENT_BEGIN_C(_colour_, _zone_name_ )
241 #define AK_INSTRUMENT_IDLE_BEGIN( _zone_name_ )
242 #define AK_INSTRUMENT_IDLE_END( _zone_name_ )
243 #define AK_INSTRUMENT_IDLE_SCOPE( _zone_name_ )
245 #define AK_INSTRUMENT_STALL_BEGIN( _zone_name_ )
246 #define AK_INSTRUMENT_STALL_END( _zone_name_ )
247 #define AK_INSTRUMENT_STALL_SCOPE( _zone_name_ )
249 #define AK_INSTRUMENT_THREAD_START( _thread_name_ )
252 #endif // _AK_TOOLS_COMMON_AKPLATFORMFUNCS_H
int nPriority
Thread priority.
Platform-dependent helpers.
AkForceInline AkUInt32 AkBitScanForward64(unsigned long long in_bits)
AkForceInline AkUInt32 ROTL32(AkUInt32 x, AkUInt32 r)
AkForceInline AkUInt32 GetNextPowerOfTwo(AkUInt32 in_uValue)
AkForceInline void AkGetDefaultThreadProperties(AkThreadProperties &out_threadProperties)
Platform Independent Helper.
void AkGetDefaultHighPriorityThreadProperties(AkThreadProperties &out_threadProperties)
AkForceInline AkUInt32 GetNumNonZeroBits(AkUInt32 in_uWord)
AkForceInline AkUInt64 ROTL64(AkUInt64 x, AkUInt64 r)
AkForceInline AkUInt32 AkBitScanForward(unsigned long in_bits)
Besoin d'aide ?
Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !
Visitez notre page d'Aide
Décrivez-nous de votre projet. Nous sommes là pour vous aider.
Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !
Partir du bon pied avec Wwise