mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
M1: Correctly detect core count.
This commit is contained in:
1 parent
20d579c3b8
commit
9c8feefcdc
2 files changed
+24
-4
No files matched your search
@@ -19,6 +19,11 @@
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#if PPSSPP_PLATFORM(MAC)
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if PPSSPP_ARCH(ARM) || PPSSPP_ARCH(ARM64)
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -246,6 +251,17 @@ void CPUInfo::Detect()
|
||||
#endif
|
||||
strcpy(brand_string, "Apple A");
|
||||
num_cores = 2;
|
||||
#elif PPSSPP_PLATFORM(MAC)
|
||||
strcpy(brand_string, "Apple M1");
|
||||
int num = 0;
|
||||
size_t sz = sizeof(num);
|
||||
if (sysctlbyname("hw.physicalcpu_max", &num, &sz, nullptr, 0) == 0) {
|
||||
num_cores = num;
|
||||
sz = sizeof(num);
|
||||
if (sysctlbyname("hw.logicalcpu_max", &num, &sz, nullptr, 0) == 0) {
|
||||
logical_cpu_count = num / num_cores;
|
||||
}
|
||||
}
|
||||
#elif PPSSPP_PLATFORM(WINDOWS)
|
||||
truncate_cpy(brand_string, GetCPUBrandString().c_str());
|
||||
isVFP3 = true;
|
||||
|
||||
Reference in new issue
Block a user