Cannot create a shared texture with iosurface on Apple silicon mac.

Trying to call [MTLDevice newTextureWithDescriptor:iosurface:plane:] on an Apple Silicon mac, where the descriptor specifies MTLStorageModeShared, I am getting a failed assertion error:

-[MTLDebugDevice newTextureWithDescriptor:iosurface:plane:]:2387: failed assertion `Texture Descriptor Validation
IOSurface textures must use MTLStorageModeManaged

I don't really understand why we have this limitation, MTLStorageModeShared textures are supported on Apple silicon (despite the documentation in https://developer.apple.com/documentation/metal/mtldevice/1433378-newtexturewithdescriptor?language=objc which claims overwise.

Hello,

I have the same issue with MacOS 13.0, it was working fine before this macOS update.

Any idea how to fix it?

Thanks

Same here, I can't compile my app on M1 anymore.

Some help here would be appreciated

The issue is still present with MacOS 13.1 RC.

It is possible to have any update from Apple, please?

Same issue with MacOS 13.1

Same issue with MacOS 13.2 Beta 2...

This worked for me

You should be able to work around it by turning off Metal Validation in Scheme -> Edit Scheme -> Run -> Diagnostics -> Metal API Validation

It's working for debugging, not for production and final users.

Juste tested MacOS 13.2, same issue.

I am getting the same issue but at the moment when i try to launch AVCaptureSession() on my M2 inside an iOS App Designed for iPad. Did someone found any solution for prod?

Seems like disabling API Validation option when running it fixes it:)

Found here

Cannot create a shared texture with iosurface on Apple silicon mac.
 
 
Q