summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2014-05-30 17:48:34 -0700
committerAnuj Phogat <anuj.phogat@gmail.com>2014-08-04 17:11:18 -0700
commit3c7a0c690a1a0d72ad2b911e4a209447ce3edc1f (patch)
treeeaac5abb50e46b585763de6c5ae2c2b618894b9d /src
parente27c9f3a02509fe59db7ec409a339cc5ea809600 (diff)
downloadexternal_mesa3d-3c7a0c690a1a0d72ad2b911e4a209447ce3edc1f.zip
external_mesa3d-3c7a0c690a1a0d72ad2b911e4a209447ce3edc1f.tar.gz
external_mesa3d-3c7a0c690a1a0d72ad2b911e4a209447ce3edc1f.tar.bz2
mesa: Fix condition for using compressed internalformat in glCompressedTexImage3D()
Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/teximage.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index b6c3e85..21ba4b6 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -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;
}