mesa,st/mesa: implement GL_RGB565 from ARB_ES2_compatibility
[mesa.git] / src / mesa / main / teximage.c
index b16baaf914cb3aeaeb4c0e8e33a1f33c3b08dd18..126386ebed612b1ff5d3f5fa3dc9a9dacf7a92f3 100644 (file)
@@ -138,6 +138,15 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
       }
    }
 
+   if (ctx->Extensions.ARB_ES2_compatibility) {
+      switch (internalFormat) {
+         case GL_RGB565:
+            return GL_RGB;
+         default:
+            ; /* fallthrough */
+      }
+   }
+
    if (ctx->Extensions.ARB_depth_texture) {
       switch (internalFormat) {
          case GL_DEPTH_COMPONENT: