Cycles: Fix animation hangs/crashes in Metal due to leaking temp objects

This PR adds `@autoreleasepool` blocks around functions that have been observed to create hidden temporary NSObjects, and eventually cause command buffer failures. A couple of allocations needed to be tweaked in order to maintain correct retain/release behaviour. This PR also fixes the command buffer error text to show more useful information.
This commit is contained in:
Michael Jones 2023-10-24 23:20:16 +01:00
parent 692292536f
commit 4e3ee4f026
3 changed files with 1093 additions and 1057 deletions

View File

@ -26,6 +26,7 @@ class MetalDevice : public Device {
id<MTLLibrary> mtlLibrary[PSO_NUM] = {nil};
id<MTLArgumentEncoder> mtlBufferKernelParamsEncoder =
nil; /* encoder used for fetching device pointers from MTLBuffers */
id<MTLCommandQueue> mtlComputeCommandQueue = nil;
id<MTLCommandQueue> mtlGeneralCommandQueue = nil;
id<MTLArgumentEncoder> mtlAncillaryArgEncoder =
nil; /* encoder used for fetching device pointers from MTLBuffers */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff