Skip to content

Conversation

@Gorggg
Copy link

@Gorggg Gorggg commented Aug 7, 2020

This fixes an issue where glReadPixels read components out-of-order on little-endian machines, leading to resulting images with inaccurate color values. To fix this, we make the pixel format value conditional on cpu endianness, which we get CMake to identify at compile time.

Thank you for reading this. If there is anything I can improve, please let me know.

This fixes an issue where glReadPixels read components out-of-order
on little-endian machines, leading to resulting images with inaccurate
color values. To fix this, we make the pixel format value conditional
on cpu endianness, which we get CMake to identify at compile time.
@landswellsong
Copy link
Member

Hello. Sorry I completely forgot about this repo. I'll get back to you as soon as I have time to brief myself back about what was going on here.

@Gorggg
Copy link
Author

Gorggg commented Jan 25, 2021

Thanks for the reply. My experience of this issue was that images resulting from glReadPixels() had distorted colors. I determined that this was because the resulting format was endianness-dependent, therefore they were reversed in certain scenarios. I fixed the issue by detecting endianness at compile-time and adjusting the format of the operation accordingly.

If there is anything more I can help you recall or clarify, please let me know, and thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants