Cycles: Add diagnostic tracing of MTLLibrary compilation time

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D15268
This commit is contained in:
Michael Jones 2022-06-23 10:05:45 +01:00 committed by Michael Jones
parent d20bad914e
commit d8e9647ae2
1 changed files with 5 additions and 2 deletions

View File

@ -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);