(Using a CAShapeLayer as the layer mask for the visual effect view completely breaks the effect)
SwiftUI does this, for reference. Wish we could have the same in UIKit
If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/simsaens/statuses/115202965094119579 on your instance and quote it. (Note that quoting is not supported in Mastodon.)