Closed AtomicVar closed 10 months ago
Hello,
I have no experience in how Objective-C - C++ interoperability works, but shouldn't there be some casting available? Maybe @philipturner can help with that question?
Maybe this comment can be useful: https://github.com/DTolm/VkFFT/issues/91#issuecomment-1695524007
Best regards, Dmitrii
There should be a way to call (__bridge void*
) and then cast the result to MTL::Device*
. It is used extensively in the Objective-C to metal-cpp interconversion in CCV.
(mtl_device_t*
is an alias of void*
)
@philipturner Awesome! That solved my problem, thank you a lot ❤️
The situation: I'm developing an iOS Metal App in Objective-C. I'm using VkFFT which provides Metal FFTs based on Metal-Cpp.
What I need: pass a
id<MTLCommandQueue>
instance from Objective-C world to C++ world as aMTL::CommandQueue
object so that I can push compute commands to it. I don't want to create a seperate commmand queue in Metal-Cpp because using a single command queue can let me keep pushing all commands to it withoutwaitUntilCompleted
.After searching the web, I didn't find out how to do that. And Metal-Cpp doesn't have Issues opened so I can only ask here.