Mesa (master): mesa: allow internalFormat=GL_BGRA_EXT in TexImage2D

Kristian Høgsberg krh at kemper.freedesktop.org
Mon Jan 24 21:42:52 UTC 2011


Module: Mesa
Branch: master
Commit: f1452844fe2522387bbc6633f22aec09b8a06204
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f1452844fe2522387bbc6633f22aec09b8a06204

Author: Benjamin Franzke <benjaminfranzke at googlemail.com>
Date:   Fri Jan 21 14:24:11 2011 +0100

mesa: allow internalFormat=GL_BGRA_EXT in TexImage2D

---

 src/mesa/main/teximage.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 47d5093..c3cd6b6 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -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:




More information about the mesa-commit mailing list