-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
IOS7: Add support for 32 bit pixel formats #4694
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some confusion with the color formats in your comments and function names. See the comments I added for more details. The support you add is actually for RGBA8888 and not ARGB8888.
Other than that, since you need to swap the bytes with RGBA8888, it could be a good idea to also add support for ABGR8888 (Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)
), and to list it first in the list of supported pixel formats. Indeed as documented some engines assume that the first listed format is the preferred one, and use it. And in this case it would be the most efficient one since it matches what you need to pass to the glTexImage2D
call (so no byte swap is needed). That should improve performances for those engines. One example that could be tested is AGS games.
Ah, I mixed up the formats. |
3c04127
to
3324f77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. You forgot a change in configure
though.
I also made another suggestion, but I think that one could be kept for later.
Add Apple Accelerate framework to iOS and tvOS targets. The framework utilizes NEON extensions on the ARM chip to accelerate calculations. This will come to use when processing texture data.
This enables some game engines only supporting 32 bit color formats, e.g. 11th hour and Broken Sword 2.5. Add support for the pixel formats RGBA8888 and ABGR8888. The pixel formats are defined in big endian while iOS utilizes little endian, thus requiring converting some formats to get correct color representation. Use the Apple Accelerate framework converting the format requiring to minimize the CPU load since this is done every frame.
3324f77
to
a9d2643
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good now. Thank you!
I will merge this now. |
No description provided.