No storageModePrivate buffers on High Sierra?

Hi,


I have recently updated my OS from Sierra to High Sierra.

I am working on a Metal2 App, which was working on my machine with Sierra.

Now after the update, I get runtime error when I want to create a storageModePrivate MTLBuffer (EXC_BAD_ACCESS).

Does anyone experienced this?

Is some backward compatibility broken?

Or is my App wrong, but the older Sierra OS has hidden the error?


Thanks in advance!

Replies

I see a change from 10.11 to 10.12, but nothing (yet) mentioned from 10.12 to 10.13, so yes, maybe 10.12 hid it...


https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOS10_12/Swift/Metal.html

I observed this on a ca. 2013 13" MacBook Pro (Intel HD Graphics 4000 only) right after upgrading to 10.13, but I'm not seeing a problem on a 2012 15" MacBook Pro (GeForce 650M) after installing the 10.13.1 public beta.


I do wonder if this is an issue with the 'newBufferWithBytes' method specifically (and not due to 'private' buffers being unavailable entirely). The documentation for this function says:

MTLBuffer
objects created with this method are CPU-accessible and can be specified with a
MTLResourceStorageModeShared
or
MTLResourceStorageModeManaged
storage mode, but not a
MTLResourceStorageModePrivate
storage mode.


Tomorrow I'll try creating a 'private' buffer & explicitly copying the data to it on the 13" MBP

I have experienced it on MacBook Air 2017 (Intel HD).

Runtime error appears when I try to initialize the buffer at creation time:


public func makeBuffer(bytes pointer: UnsafeRawPointer, length: Int, options: MTLResourceOptions = []) -> MTLBuffer?


There is no proble when I create a buffer without initialization:


public func makeBuffer(length: Int, options: MTLResourceOptions = []) -> MTLBuffer?


Ok, it could be logical that for GPU private buffer an explicit blit command is needed for filling it up from the CPU. But why was it working on Sierra?