From 410e4e7ce1823aa15d51ee231eedc63cdf72c8e3 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Thu, 10 Feb 2022 10:51:11 +0000 Subject: Workaround for T94142: Cycles Metal crash with simultaneous viewport and final render Disable binary archives on Apple Silicon (issue stems from instancing multiple PSOs from the same binary archive). Pipeline creation still filters through the OS shader cache, mitigating any impact on setup times after the initial render. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14072 --- intern/cycles/device/metal/kernel.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/cycles/device/metal/kernel.mm b/intern/cycles/device/metal/kernel.mm index e9bd1cea5df..91aac8831ca 100644 --- a/intern/cycles/device/metal/kernel.mm +++ b/intern/cycles/device/metal/kernel.mm @@ -59,10 +59,15 @@ bool MetalDeviceKernel::load(MetalDevice *device, } bool use_binary_archive = true; - if (getenv("CYCLES_METAL_DISABLE_BINARY_ARCHIVES")) { + if (device->device_vendor == METAL_GPU_APPLE) { + /* Workaround for T94142: Cycles Metal crash with simultaneous viewport and final render */ use_binary_archive = false; } + if (auto str = getenv("CYCLES_METAL_DISABLE_BINARY_ARCHIVES")) { + use_binary_archive = (atoi(str) == 0); + } + id archive = nil; string metalbin_path; if (use_binary_archive) { -- cgit v1.2.3