mesa: Fix condition for using compressed internalformat in glCompressedTexImage3D()
authorAnuj Phogat <anuj.phogat@gmail.com>
Sat, 31 May 2014 00:48:34 +0000 (17:48 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Tue, 5 Aug 2014 00:11:18 +0000 (17:11 -0700)
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/main/teximage.c

index b6c3e855d372d52461ee7abdf12e3ddf89bdfac2..21ba4b624be612f55d53381cdfcab0790ff315b3 100644 (file)
@@ -2299,7 +2299,14 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
 
    if (!_mesa_target_can_be_compressed(ctx, target, internalFormat)) {
       reason = "target";
-      error = GL_INVALID_ENUM;
+      /* From section 3.8.6, page 146 of OpenGL ES 3.0 spec:
+       *
+       *    "The ETC2/EAC texture compression algorithm supports only
+       *     two-dimensional images. If internalformat is an ETC2/EAC format,
+       *     CompressedTexImage3D will generate an INVALID_OPERATION error if
+       *     target is not TEXTURE_2D_ARRAY."
+       */
+      error = _mesa_is_desktop_gl(ctx) ? GL_INVALID_ENUM : GL_INVALID_OPERATION;
       goto error;
    }