Swift struct to Metal

Hello,

I begin / test a little with Swift and Metal (only for compute shaders). All I see (in samples) is working with primitive datatypes but I work with struct or classes. Can I and How move data between Swift and Metal in a struct or in other words declare a kernel function with struct and used from Swift? Is somewhere an example?

I want to compute with 100+ input parameters and not much less result values for maybe more than hundred thousand times.

Thanks Sebastian

Accepted Answer
Swift struct to Metal
 
 
Q