-1

I’m developing an iOS app and solved the interoperability Swift-C++ in the CPU side wrapping the C++ classes in Objective-C. But on the GPU side, I don’t Know if exists any way of call and retrieve data from a pure C++ class (not MSL). Since MSL is C++ based my intuition says that yes but I didn’t find any information in that way…

I’m trying to use libraries like CGAL or FastNoise to update a massive number of particles.

1 Answers1

1

Welcome!

I'm afraid you can't just access any data from any class in your GPU code. Programming for the GPU requires a very different paradigm. You have to explicitly send data to the GPU, trigger computational tasks a.k.a. "kernels" to run on the GPU, wait for their completion, and transfer the data back to the RAM.

I recommend you check out some tutorials on Metal. Here is for example a sample project where image data is modified on the GPU using compute kernels.

Frank Rupprecht
  • 9,191
  • 31
  • 56