mesa: Only advertise GL_ETC1_RGB8_OES in ES contexts
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 19 Aug 2013 20:16:54 +0000 (13:16 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 21 Aug 2013 14:46:51 +0000 (07:46 -0700)
There is no extension for this format in desktop GL, so an application
can't give the format back to glCompressedTexImage2D.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
src/mesa/main/texcompress.c

index 58859440c2463ca72f332de0ecfefc1a6cd0c1ef..334ea4068d921bf6ffd020fb6ee99727174dd4e7 100644 (file)
@@ -277,7 +277,15 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
       }
    }
 
-   if (ctx->Extensions.OES_compressed_ETC1_RGB8_texture) {
+   /* The GL_OES_compressed_ETC1_RGB8_texture spec says:
+    *
+    *     "New State
+    *
+    *         The queries for NUM_COMPRESSED_TEXTURE_FORMATS and
+    *         COMPRESSED_TEXTURE_FORMATS include ETC1_RGB8_OES."
+    */
+   if (_mesa_is_gles(ctx)
+       && ctx->Extensions.OES_compressed_ETC1_RGB8_texture) {
       if (formats) {
          formats[n++] = GL_ETC1_RGB8_OES;
       }