OSDN Git Service

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 47d5093..c3cd6b6 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: