mesa: Support internalFormat=GL_BGRA for DRI drivers
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 26 Jan 2011 20:05:46 +0000 (15:05 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 26 Jan 2011 20:05:46 +0000 (15:05 -0500)
src/mesa/main/texformat.c

index 146b2b340e7102e3537b02632c2ea6d83e4fff7c..2542cea856b65154e1b15504bc523b1b65b2b7f0 100644 (file)
@@ -591,6 +591,17 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
       }
    }
 
+   if (ctx->Extensions.EXT_texture_format_BGRA8888) {
+      switch (internalFormat) {
+      case GL_BGRA:
+        RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+        break;
+
+      default:
+         ; /* fallthrough */
+      }
+   }
+
    _mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()");
    return MESA_FORMAT_NONE;
 }