Previously, internalformat GL_RGBA and type GL_UNSIGNED_SHORT_5_5_5_1
was promoted to RGBA8888 as the table entry with the 5551 formats
is listed below the 8888 entry, and it also doesn't have GL_RGBA as
a possible internalformat.
Using actual 5551 fixes the following dEQP-EGL test:
- dEQP-EGL.functional.image.modify.tex_rgb5_a1_tex_subimage_rgba8
Reviewed-by: Eric Anholt <eric@anholt.net>
internalFormat = GL_RGB10_A2;
}
+ if (type == GL_UNSIGNED_SHORT_5_5_5_1) {
+ if (internalFormat == GL_RGB)
+ internalFormat = GL_RGB5;
+ else if (internalFormat == GL_RGBA)
+ internalFormat = GL_RGB5_A1;
+ }
+
/* search table for internalFormat */
for (i = 0; i < ARRAY_SIZE(format_map); i++) {
const struct format_mapping *mapping = &format_map[i];