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
This commit is contained in:
Michael Jones (Apple) 2022-02-10 10:51:11 +00:00
parent 25c4000796
commit 410e4e7ce1
1 changed files with 6 additions and 1 deletions

View File

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