Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Accelerate framework for texture image processing on iOS and fix premultiplication issues #6470

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented Dec 22, 2024

Apple offers high-performance / SIMD-based image processing API under its Accelerate framework called vImage, suiting our needs perfectly as well as providing support for non-premultiplied image loading (I've only been aware of this as I was working towards changing the entire game to use premultiplied colours).

The benchmark methodology may be basic, but I've benchmarked this by measuring time spent on loading each texture while randomly browsing through osu!. Results show roughly close match between master and this PR.

To ensure the premultiplication issues are appropriately fixed, I've added a test scene for it.

The intro artifacts in ppy/osu#9922 will not be fixed by this PR. A separate PR will handle this (ppy/osu-resources#351).

iOS master iOS this PR
CleanShot 2024-12-22 at 17 12 51 CleanShot 2024-12-22 at 17 12 45

@peppy
Copy link
Member

peppy commented Dec 23, 2024

Nice one finding this. Let's get it in and see how it goes.

As touched on in discord, premult should still be our end-goal, but it can be put on the backburner as it's more of an optimisation than a must-have.

@peppy peppy merged commit fe60bf5 into ppy:master Dec 23, 2024
12 of 14 checks passed
@frenzibyte frenzibyte deleted the ios-vimage branch December 23, 2024 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS image loading using incorrect premultiplied mode for skinned resources
2 participants