diff options
author | Chris Robinson <[email protected]> | 2012-10-07 08:18:22 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-10-07 08:18:22 -0700 |
commit | 65c7c468cc0847d66b2bfd1355a2d4cc49a458a5 (patch) | |
tree | e094c5273efe2f0309f4730912d5b8fe3fb60360 | |
parent | ebdf6367597d6cad0d6b53a3186c9331b20c94dd (diff) |
Use IsProcessorFeaturePresent to detect SSE on Windows
-rw-r--r-- | Alc/helpers.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Alc/helpers.c b/Alc/helpers.c index 262c2551..e84454fb 100644 --- a/Alc/helpers.c +++ b/Alc/helpers.c @@ -109,6 +109,16 @@ void FillCPUCaps(ALuint capfilter) #endif } } +#elif defined(HAVE_WINDOWS_H) + BOOL (WINAPI*IsProcessorFeaturePresent)(DWORD ProcessorFeature); + IsProcessorFeaturePresent = GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent"); + if(!IsProcessorFeaturePresent) + ERR("IsProcessorFeaturePresent not available; CPU caps not detected\n"); + else + { + if(IsProcessorFeaturePresent(6/*PF_XMMI_INSTRUCTIONS_AVAILABLE*/)) + caps |= CPU_CAP_SSE; + } #endif #endif #ifdef HAVE_NEON |