OpenGLテクスチャフォーマット

glTexImage2Dとかに渡すテクスチャフォーマットのメモ。 GL_UNPACK_SWAP_BYTESをオンにするとエンディアンが反転します。

bppendianformattype1st byte2nd byte3rd byte4th byte
32bpp big GL_RGBA GL_UNSIGNED_BYTE RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA
GL_UNSIGNED_INT_8_8_8_8 RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA
GL_UNSIGNED_INT_8_8_8_8_REV AAAAAAAABBBBBBBBGGGGGGGGRRRRRRRR
GL_UNSIGNED_INT_10_10_10_2 RRRRRRRRRRGGGGGGGGGGBBBBBBBBBBAA
GL_UNSIGNED_INT_2_10_10_10_REVAABBBBBBBBBBGGGGGGGGGGRRRRRRRRRR
GL_BGRA GL_UNSIGNED_BYTE BBBBBBBBGGGGGGGGRRRRRRRRAAAAAAAA
GL_UNSIGNED_INT_8_8_8_8 BBBBBBBBGGGGGGGGRRRRRRRRAAAAAAAA
GL_UNSIGNED_INT_8_8_8_8_REV AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB
GL_UNSIGNED_INT_10_10_10_2 BBBBBBBBBBGGGGGGGGGGRRRRRRRRRRAA
GL_UNSIGNED_INT_2_10_10_10_REVAARRRRRRRRRRGGGGGGGGGGBBBBBBBBBB
GL_ABGR_EXT GL_UNSIGNED_BYTE AAAAAAAABBBBBBBBGGGGGGGGRRRRRRRR
GL_UNSIGNED_INT_8_8_8_8 AAAAAAAABBBBBBBBGGGGGGGGRRRRRRRR
GL_UNSIGNED_INT_10_10_10_2AAAAAAAAAABBBBBBBBBBGGGGGGGGGGRR
little GL_RGBA GL_UNSIGNED_BYTE RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA
GL_UNSIGNED_INT_8_8_8_8 AAAAAAAABBBBBBBBGGGGGGGGRRRRRRRR
GL_UNSIGNED_INT_8_8_8_8_REV RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA
GL_UNSIGNED_INT_10_10_10_2 BBBB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