Windows: Switch to ProcessorNameString for CPU identification on ARM64

This probably should always have been the value used, really.

Now, instead of reporting `Qualcomm Technologies Inc`, it reports the more informative `Snapdragon(R) X Elite - X1E78100 - Qualcomm(R) Oryon(TM) CPU` on a Thinkpad T14s Gen6 device.

Pull Request: https://projects.blender.org/blender/blender/pulls/128808
This commit is contained in:
Anthony Roberts
2024-10-10 10:37:17 +02:00
parent f666902d17
commit ef58d4ae26
2 changed files with 12 additions and 12 deletions

View File

@@ -97,17 +97,17 @@ string system_cpu_brand_string()
return brand;
}
#elif defined(_M_ARM64)
DWORD vendorIdentifierLength = 255;
char vendorIdentifier[255];
DWORD processorNameStringLength = 255;
char processorNameString[255];
if (RegGetValueA(HKEY_LOCAL_MACHINE,
"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
"VendorIdentifier",
"ProcessorNameString",
RRF_RT_REG_SZ,
nullptr,
&vendorIdentifier,
&vendorIdentifierLength) == ERROR_SUCCESS)
&processorNameString,
&processorNameStringLength) == ERROR_SUCCESS)
{
return vendorIdentifier;
return processorNameString;
}
#else
/* Get from /proc/cpuinfo on Unix systems. */

View File

@@ -141,17 +141,17 @@ char *BLI_cpu_brand_string(void)
}
#else
/* No CPUID on ARM64, so we pull from the registry (on Windows) instead. */
DWORD vendorIdentifierLength = 255;
char vendorIdentifier[255];
DWORD processorNameStringLength = 255;
char processorNameString[255];
if (RegGetValueA(HKEY_LOCAL_MACHINE,
"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
"VendorIdentifier",
"ProcessorNameString",
RRF_RT_REG_SZ,
NULL,
&vendorIdentifier,
&vendorIdentifierLength) == ERROR_SUCCESS)
&processorNameString,
&processorNameStringLength) == ERROR_SUCCESS)
{
return BLI_strdup(vendorIdentifier);
return BLI_strdup(processorNameString);
}
#endif
return NULL;