Slow Frame Rates on 2017+ Macs

Can this get some love now that ADC is done so it could be enabled by default on available platform ?

Thanks !

2 Likes

I think it’s still a lot to learn about exactly how it works. We tried activating on one of our products and it completely messed it up.

More knowledge is needed about it and what it does exactly as well.

But so do agree it’s worth it to jump on this soon.

1 Like

Can I ask what messed up?
We’ve been shipping with this turned on for about a month now and apart from a couple of plugin UIs that didn’t show (so we’ve disabled this now for plugin windows) I’ve not seen any issues.

I’m interested to know if there’s things that might be broken but hidden in our UI.


Ed added the option to disable this on a per-ComponentPeer basis so extra “love” do you think it requires?

1 Like

I’m seeing some spurious horizontal lines on non retina displays. Not sure where they are coming from.

screenshot?

image

The line above the text. It’s only there non retina, it might be the edge of one component. Not really sure what’s causing it.

The whole “product-card” is only one component, but it uses multiple paint calls (first background, then icon, then name and finally the status at the bottom). I think the line comes from the icon. It draws one more line than it should, depending on the transform of the image.

Juce has some weird issues drawing images that are scaled. Especially with OpenGL you see a lot of “garbage” pixels around images that are very noticeable depending on the background they are drawn on.

The Mac version doesn’t use OpenGL, but it’s still HW accelerated and apparently reads outside the bounds of the image-texture.

The icons are SVG, but are cached into an image to enhance performance, because drawing 100+ SVG with gradients in them is just too slow.

Maybe it would be a good idea to add a one-pixel safety margin around all image-textures that Juce creates, so these artifacts are at least not visible.

We can’t do that, because the issue is that the shader reads over the image-edge, so even if we added 10 empty pixels around our image, the shader still reads one pixel more and thus draws whatever is next to it in texture memory.

It’s not unusual to have this extra safety pixel around textures in other industries (mainly gaming).

1 Like

@RolandMR Does this also happen on an external display or if you open on a Retina display but in “low-resolution” mode?

Hey Dave,

How did you use setComponentAsyncLayerBackedViewDisabled() ?

I’m getting “use of undeclared identifier ‘setComponentAsyncLayerBackedViewDisabled’”.

I have a Component where I need to disable this. It’s like I’m missing a header.

Rail

Juce has some weird issues drawing images that are scaled. Especially with OpenGL you see a lot of “garbage” pixels around images that are very noticeable depending on the background they are drawn on.

I had similar issue in OpenGL with scaling as well.
I don’t mind seeing this fixed as well :slight_smile:

You’ll need to add an extern void setComponentAsyncLayerBackedViewDisabled (Component& comp, bool shouldDisableAsyncLayerBackedView); somewhere in your code (not in the JUCE namespace).

1 Like

Any news on this ? :smile:

What issue are you referring to?
“Weirdness” drawing scaled images? Or something else?

Do you have a test case that exhibits the problem as I’ve not been able to find one…

in my case, with opengl it’s border, it’s border issue like that

But honestly this is not related to the subject here which is the JUCE_COREGRAPHICS_DRAW_ASYNC flag

Ah ok, that was what confused me.
I’ve been shipping with this Metal backend for months now so I’m interested in any edge cases I may have missed…

Wait what… “this Metal backend”?? Sounds intriguing - what is it?

See dave’s reply around #24 Slow Frame Rates on 2017+ Macs

It means they are way ahead of Juce itself?

You can use the async metal backend right now in JUCE by specifying JUCE_COREGRAPHICS_DRAW_ASYNC=1 in your project’s preprocessor definitions.

1 Like