Metal CIKernel instances with arbitrarily structured data arguments

Hi,

In the iOS13 and macOS Catalina release notes it says:

Metal CIKernel instances now support arguments with arbitrarily structured data.

I've been trying to use this functionality in a CIKernel with mixed results. I'm particularly interested in passing data in the form of a dynamically sized array. It seems to work up to a certain size. Beyond the threshold excessive data is discarded and the kernel becomes unstable. I assume there is some kind of memory alignment issue going on, but I've tried various types in my array and always get a similar result.

I have not found any documentation or sample code regarding this. It would be great to know how this is intended to work and what the limitations are.

In the forums there are two similar unanswered questions about data arguments, so I'm sure there are a few out there with similar issues.

Thanks! Michael

Hello,

Can you provide the host code that declares and passes the array as an argument?

Likewise, can you provide the kernel declaration and the code that accesses the array?

If you could provide both in an Xcode project that would be ideal.

Please link the other forum posts for context.

Metal CIKernel instances with arbitrarily structured data arguments
 
 
Q