diff options
author | Michael Jones <michael_jones> | 2022-06-23 12:05:45 +0300 |
---|---|---|
committer | Michael Jones <michael_p_jones@apple.com> | 2022-06-23 12:06:20 +0300 |
commit | d8e9647ae26b1681f1a2345975e52c512ff15e20 (patch) | |
tree | aea8e515c0ce52e6bdc90b896d29fac2ff740b0d /intern/cycles/device/metal/device_impl.mm | |
parent | d20bad914e310f93f53dba4decf6e1e534a08345 (diff) |
Cycles: Add diagnostic tracing of MTLLibrary compilation time
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D15268
Diffstat (limited to 'intern/cycles/device/metal/device_impl.mm')
-rw-r--r-- | intern/cycles/device/metal/device_impl.mm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index 8edcd8d118d..a0abb3fca37 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -280,14 +280,17 @@ bool MetalDevice::load_kernels(const uint _kernel_features) motion_blur = kernel_features & KERNEL_FEATURE_OBJECT_MOTION; source[PSO_GENERIC] = get_source(kernel_features); + + const double starttime = time_dt(); + mtlLibrary[PSO_GENERIC] = compile(source[PSO_GENERIC]); + metal_printf("Front-end compilation finished in %.1f seconds (generic)\n", time_dt() - starttime); + MD5Hash md5; md5.append(source[PSO_GENERIC]); source_md5[PSO_GENERIC] = md5.get_hex(); - metal_printf("Front-end compilation finished (generic)\n"); - bool result = MetalDeviceKernels::load(this, false); reserve_local_memory(kernel_features); |