Using Metal Inside of Juce

Could someone please explain how one would integrate Apple Metal rendering into Juce? I disagree that Metal is not needed right now, given that Mojave and the newest iOS versions will not support OpenGL. Also, learning from another Juce dev, I understand that Vulkan is extremely hard to integrate with Juce.

I need to get ahead of this as I’m planning on quite a few big iOS apps and need to really manage memory in Auv3 to under 350 Meg. That’s very hard to do without SVG, but SVG takes up a lot more CPU.

If anyone has successfully integrated Metal into Juce, any help would be appreciated.

1 Like

For the curious - Vulkan is much lower-level than OpenGL. And in practical terms for JUCE users, it can only work on a small subset of mobile devices and some desktop systems - due to driver limitations or lacking driver implementations.

2 Likes

OpenGL is working fine on all of the latest iterations of Apple’s operating systems. There’s a big difference between marking something as deprecated and actually removing it. I agree with the general gist of what you are saying though and we’re looking at Metal support.

1 Like

Ok…I see…

So at this point there is no way to integrate Metal gracefully, if I really needed to?

What do you mean by “integrate”? Use Metal as a graphics backend for all JUCE rendering or issuing your own, custom, Metal drawing commands to a context?

Metal drawing commands

JUCE is modular. you can do your own frontend but then your app will target specific platform of course…
https://docs.juce.com/master/classNSViewComponent.html

4 Likes

Also, depending on your needs, if you’re only targeting iOS you might want to look at AudioKit too…

1 Like

So basically just be patient and wait :+1:t4:

Why don’t you render your SVG’s to an Image on startup and use that during the live time of your app, this way the SVG doesn’t have to be rasterised over and over again.

@Rebbur That solves the CPU issue, but doesn’t solve the RAM restrictions of only 350MB using AUv3. When you render to an image, you still have to deal with the size, because now we are back to png’s. A 2732 x 2048 image is about 80MB extra. SVG removes all of that, but then it adds a ton of CPU, so we are trying a hybrid method.

We are going to try some painting tricks to see if that helps

We target Desktop Windows as well as having our eye on Android, so need the cross platform nature of Juce

Hate to break it to you but in my experience using a Metal view for your AUv3 GUI on iOS seriously bumps the memory footprint when compared to e.g. using UIKit (or probably JUCE’s CG graphics backend (not sure about GL).

3 Likes