From ef58d4ae26ebc926be0bd46fefff030018af5dd1 Mon Sep 17 00:00:00 2001 From: Anthony Roberts Date: Thu, 10 Oct 2024 10:37:17 +0200 Subject: [PATCH] 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 --- intern/cycles/util/system.cpp | 12 ++++++------ source/blender/blenlib/intern/system.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/intern/cycles/util/system.cpp b/intern/cycles/util/system.cpp index 1e0cbe8cfa6..54d5908beda 100644 --- a/intern/cycles/util/system.cpp +++ b/intern/cycles/util/system.cpp @@ -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. */ diff --git a/source/blender/blenlib/intern/system.c b/source/blender/blenlib/intern/system.c index 6c431da5d53..1361b541c92 100644 --- a/source/blender/blenlib/intern/system.c +++ b/source/blender/blenlib/intern/system.c @@ -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;