I’m having a bit of trouble deciphering the glReadPixels documentation in figuring out what format/type pairs are guaranteed to be available on all systems.
In the “Notes” section, the documentation seems to imply that the only valid pairs are:
I am currently unable to read the GL_IMPLEMENTATION_* values on my device, as I am somehow receiving a GL_INVALID_OPERATION error from glGetIntegerv, but in any case, I am confused as to the results.
On my Android phone,
GL_FLOAT works fine, as does
GL_FLOAT, which is two additional pairs not mentioned in the Notes section as guaranteed to be valid. At the same time, the pairing
GL_UNSIGNED_BYTE results in GL_INVALID_OPERATION, so I think it is safe to say that it is not the case that
GL_FLOAT, even if they are the
GL_IMPLEMENTATION_* values, simply pair with everything else valid.
In light of this, I am not quite sure how to interpret what I’m seeing. My two attempts are:
GL_FLOATis a valid pairing on all platforms, and then
GL_FLOATis the single
GL_IMPLEMENTATION_*pairing that’s available.
- Multiple implementation-specific pairings may exist depending on the device, but only one is “discoverable” by reading the
Of course, it’s quite possible that neither of the above are true, and I’m completely misinterpreting things. I would like for 1. or something similar to be true, as it would allow me to safely read floats on all platforms, but I’m not confident in assuming that it’s the case. How should I be interpreting which pairs are valid?
If I get the glGetIntegerv call working, I’ll update this post with the values that I receive.