mesa: allow internalFormat=GL_BGRA_EXT in TexImage2D
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 21 Jan 2011 13:24:11 +0000 (14:24 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 24 Jan 2011 21:41:29 +0000 (16:41 -0500)
src/mesa/main/teximage.c

index 47d509396a788857a4e2a4d3416b4053cb4229fb..c3cd6b66ae6f78352a3584ab680b1e09f15e6fe9 100644 (file)
@@ -183,6 +183,15 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
          ; /* fallthrough */
    }
 
+   if (ctx->Extensions.EXT_texture_format_BGRA8888) {
+      switch (internalFormat) {
+         case GL_BGRA_EXT:
+            return GL_RGBA;
+         default:
+            ; /* fallthrough */
+      }
+   }
+
    if (ctx->Extensions.EXT_paletted_texture) {
       switch (internalFormat) {
          case GL_COLOR_INDEX: