Skip to content

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

Merged
peppy merged 2 commits into
ppy:masterfrom
frenzibyte:ios-vimage
Dec 23, 2024
Merged

Use Accelerate framework for texture image processing on iOS and fix premultiplication issues#6470
peppy merged 2 commits into
ppy:masterfrom
frenzibyte:ios-vimage

Conversation

@frenzibyte

@frenzibyte frenzibyte commented Dec 22, 2024

Copy link
Copy Markdown
Member

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

peppy commented Dec 23, 2024

Copy link
Copy Markdown
Member

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.

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