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 RGBA8 for png and jpg #5232

Merged
merged 2 commits into from Apr 11, 2023
Merged

Use RGBA8 for png and jpg #5232

merged 2 commits into from Apr 11, 2023

Conversation

slimbuck
Copy link
Member

The image loader was specifying RGB8 pixel format for JPG, but this incurs a format conversion cost when using ImageBitmap.

This PR standardises on RGBA8 instead, speeding up JPG loading in Chrome.

@slimbuck slimbuck added the area: graphics Graphics related issue label Apr 11, 2023
@slimbuck slimbuck requested a review from a team April 11, 2023 09:41
@slimbuck slimbuck self-assigned this Apr 11, 2023
Copy link
Contributor

@willeastcott willeastcott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there memory implications we're concerned about for switching the format from RGB8 to RGBA8?

@slimbuck
Copy link
Member Author

Nope. GPUs store textures in 32bits anyway, never 24.

@slimbuck slimbuck merged commit fded38f into playcanvas:main Apr 11, 2023
7 checks passed
@slimbuck slimbuck deleted the img-fix branch April 11, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants