mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_base_tex_format
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 12 Sep 2011 16:37:50 +0000 (11:37 -0500)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 19 Sep 2011 17:04:46 +0000 (10:04 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
src/mesa/main/teximage.c

index 6113b2e9e79daab1008dcebe3c398f842bc8dc68..76dcd9c514d800e8577e6cfba23b9e0d75201cee 100644 (file)
@@ -511,6 +511,25 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
       }
    }
 
+   if (ctx->API == API_OPENGLES) {
+      switch (internalFormat) {
+      case GL_PALETTE4_RGB8_OES:
+      case GL_PALETTE4_R5_G6_B5_OES:
+      case GL_PALETTE8_RGB8_OES:
+      case GL_PALETTE8_R5_G6_B5_OES:
+        return GL_RGB;
+      case GL_PALETTE4_RGBA8_OES:
+      case GL_PALETTE8_RGB5_A1_OES:
+      case GL_PALETTE4_RGBA4_OES:
+      case GL_PALETTE4_RGB5_A1_OES:
+      case GL_PALETTE8_RGBA8_OES:
+      case GL_PALETTE8_RGBA4_OES:
+        return GL_RGBA;
+      default:
+         ; /* fallthrough */
+      }
+   }
+
    return -1; /* error */
 }