JUCE7 CGMetalLayerRenderer asserts on resize

I’ve tried to run a project with the newer metal based CG.

With the following:

JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS

I can easily reproduce the following assert once in a while during window resizing.

[MTLDebugTexture setPurgeableState:]:704: failed assertion `Set Purgeable Stage Validation
Cannot set purgeability state to volatile while resource is in use by a command buffer.

Happens on TextureDeleter struct.

This is with MBP M1 Pro.

I’ll try to reproduce with the demo projects and update once/if I’m able also to see same behaviour with JUCE examples.

Ok, I’m able to reproduce this also with the AudioDemoPlugin.

I guess it’s related to some component hierarchy since AnimationDemo won’t reproduce this.

It’s indeed only reproduced with JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS turned on.