diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-10-23 02:33:25 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-10-23 02:33:25 +0300 |
commit | b5a69061e7d464914662ae0dd6fed46a999a56bb (patch) | |
tree | 65c759445544e86be0df088a7dfdd9d91de752a7 /intern/cycles/device/metal/kernel.mm | |
parent | c51beeb56a4cc0ad3f52f6ee7467e469f32f0ea8 (diff) | |
parent | d57352b1147642660c13aeb17a0c603593fc0dea (diff) |
Merge branch 'master' into temp-sculpt-brush-channel
Diffstat (limited to 'intern/cycles/device/metal/kernel.mm')
-rw-r--r-- | intern/cycles/device/metal/kernel.mm | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/intern/cycles/device/metal/kernel.mm b/intern/cycles/device/metal/kernel.mm index 385cb412b06..5e0cb6d18f4 100644 --- a/intern/cycles/device/metal/kernel.mm +++ b/intern/cycles/device/metal/kernel.mm @@ -308,26 +308,29 @@ MetalKernelPipeline *ShaderCache::get_best_pipeline(DeviceKernel kernel, const M bool MetalKernelPipeline::should_use_binary_archive() const { - if (auto str = getenv("CYCLES_METAL_DISABLE_BINARY_ARCHIVES")) { - if (atoi(str) != 0) { - /* Don't archive if we have opted out by env var. */ - return false; + /* Issues with binary archives in older macOS versions. */ + if (@available(macOS 13.0, *)) { + if (auto str = getenv("CYCLES_METAL_DISABLE_BINARY_ARCHIVES")) { + if (atoi(str) != 0) { + /* Don't archive if we have opted out by env var. */ + return false; + } } - } - if (pso_type == PSO_GENERIC) { - /* Archive the generic kernels. */ - return true; - } + if (pso_type == PSO_GENERIC) { + /* Archive the generic kernels. */ + return true; + } - if (device_kernel >= DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND && - device_kernel <= DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW) { - /* Archive all shade kernels - they take a long time to compile. */ - return true; - } + if (device_kernel >= DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND && + device_kernel <= DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW) { + /* Archive all shade kernels - they take a long time to compile. */ + return true; + } - /* The remaining kernels are all fast to compile. They may get cached by the system shader cache, - * but will be quick to regenerate if not. */ + /* The remaining kernels are all fast to compile. They may get cached by the system shader + * cache, but will be quick to regenerate if not. */ + } return false; } |