diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-02-11 21:44:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-02-11 21:44:27 +0300 |
commit | ad53cb0b9df4543fc26ca1e8c690afffb1615bc9 (patch) | |
tree | 810e02d780307b4d5158336eca10d58fb67e5a51 /intern/cycles/device/metal/device_impl.mm | |
parent | ed4b03215533e601a7a47bc949aae7e49d53e5b7 (diff) | |
parent | 40fce61a6abe79508022d3e0cd3a29e187f18e74 (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'intern/cycles/device/metal/device_impl.mm')
-rw-r--r-- | intern/cycles/device/metal/device_impl.mm | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index ff1db59e393..593c9c3cf06 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -40,16 +40,10 @@ MetalDevice::MetalDevice(const DeviceInfo &info, Stats &stats, Profiler &profile mtlDevId = info.num; /* select chosen device */ - vector<MetalPlatformDevice> usable_devices; - MetalInfo::get_usable_devices(&usable_devices); - if (usable_devices.size() == 0) { - set_error("Metal: no devices found."); - return; - } + auto usable_devices = MetalInfo::get_usable_devices(); assert(mtlDevId < usable_devices.size()); - MetalPlatformDevice &platform_device = usable_devices[mtlDevId]; - mtlDevice = platform_device.device_id; - device_name = platform_device.device_name; + mtlDevice = usable_devices[mtlDevId]; + device_name = [mtlDevice.name UTF8String]; device_vendor = MetalInfo::get_vendor_from_device_name(device_name); assert(device_vendor != METAL_GPU_UNKNOWN); metal_printf("Creating new Cycles device for Metal: %s\n", device_name.c_str()); |