diff options
author | Peter Kim <pk15950@gmail.com> | 2022-09-08 07:00:12 +0300 |
---|---|---|
committer | Peter Kim <pk15950@gmail.com> | 2022-09-08 07:00:12 +0300 |
commit | 00dcfdf916c69672210b006e62d966f1bc2fbeb7 (patch) | |
tree | 0cbb1b91fe26c750197126085b74224a795a103c /intern/cycles/device/metal/device.mm | |
parent | a39532670f6b668da7be5810fb1f844b82feeba3 (diff) | |
parent | d5934974219135102f364f57c45a8b1465e2b8d9 (diff) |
Merge branch 'master' into xr-devxr-dev
Diffstat (limited to 'intern/cycles/device/metal/device.mm')
-rw-r--r-- | intern/cycles/device/metal/device.mm | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/intern/cycles/device/metal/device.mm b/intern/cycles/device/metal/device.mm index d7f190fc01e..51e3323370a 100644 --- a/intern/cycles/device/metal/device.mm +++ b/intern/cycles/device/metal/device.mm @@ -34,7 +34,8 @@ void device_metal_info(vector<DeviceInfo> &devices) int device_index = 0; for (id<MTLDevice> &device : usable_devices) { /* Compute unique ID for persistent user preferences. */ - string device_name = [device.name UTF8String]; + string device_name = MetalInfo::get_device_name(device); + string id = string("METAL_") + device_name; /* Hardware ID might not be unique, add device number in that case. */ @@ -48,12 +49,6 @@ void device_metal_info(vector<DeviceInfo> &devices) info.type = DEVICE_METAL; info.description = string_remove_trademark(string(device_name)); - /* Ensure unique naming on Apple Silicon / SoC devices which return the same string for CPU and - * GPU */ - if (info.description == system_cpu_brand_string()) { - info.description += " (GPU)"; - } - info.num = device_index; /* We don't know if it's used for display, but assume it is. */ info.display_device = true; @@ -69,14 +64,15 @@ string device_metal_capabilities() { string result = ""; auto allDevices = MTLCopyAllDevices(); - uint32_t num_devices = allDevices.count; + uint32_t num_devices = (uint32_t)allDevices.count; if (num_devices == 0) { return "No Metal devices found\n"; } result += string_printf("Number of devices: %u\n", num_devices); for (id<MTLDevice> device in allDevices) { - result += string_printf("\t\tDevice: %s\n", [device.name UTF8String]); + string device_name = MetalInfo::get_device_name(device); + result += string_printf("\t\tDevice: %s\n", device_name.c_str()); } return result; |