MTLDebugCommandBuffer lockPurgeableObjects

I'm using Xcode 13 after recently updating to MacOS Monterey, and only after updating am I getting this error: [MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion `MTLResource 0x14a8a8cc0 (label: null), referenced in cmd buffer 0x149091400 (label: null) is in volatile or empty purgeable state at commit'

I haven't changed my code at all between updating to the latest OS, and it worked perfectly before. How can I fix this? I don't think there should be any reason that I can't use a command buffer on a texture resource with a volatile/empty purgeable state.

I'm having this same issue. Mine is trying to run a Unity ARFoundation project, Xcode 12.4, to a dev iPhone (auto signed and connected via USB) on 15.1

The AR is embedded in a Flutter project, the rest of the app runs fine until launching AR.

Also works fine on Android

As am I. Unity 2020.3.24f1 project a macos binary and running it on MacOS Monterey. Same symptoms

I don't' think we've seen this issue. Can someone create a Feedback Assistant report and perhaps include a backtrace?

You may be able to set the following env var which would report Metal validation errors to the console instead of asserting:

MTL_DEBUG_LAYER_ERROR_MODE=nslog

There is a thread on the Unity forums discussing this. The Metal Debug layer is properly asserting due to Unity's invalid use of the Metal API. Looks like they attempted to fix it, but developers still see it in 24f1 (https://forum.unity.com/threads/metal-api-validation-is-crash-on-ios15.1185592/). Please work with Unity on providing a fix.

MTLDebugCommandBuffer lockPurgeableObjects
 
 
Q