Commit: 410e4e7ce1823aa15d51ee231eedc63cdf72c8e3
Author: Michael Jones
Date:   Thu Feb 10 10:51:11 2022 +0000
Branches: blender-v3.1-release
https://developer.blender.org/rB410e4e7ce1823aa15d51ee231eedc63cdf72c8e3

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

===================================================================

M       intern/cycles/device/metal/kernel.mm

===================================================================

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<MTLBinaryArchive> archive = nil;
   string metalbin_path;
   if (use_binary_archive) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to