summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstorage.c
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2015-08-21 13:09:08 -0700
committerNanley Chery <nanley.g.chery@intel.com>2015-08-25 15:53:46 -0700
commit1d2a844e7d55645ea3d24fb589bec03695b3d2b1 (patch)
tree91d16c83093366dd4f70e1f412da3c77fcd3003f /src/mesa/main/texstorage.c
parent26c549e69d12e44e2e36c09764ce2cceab262a1b (diff)
downloadexternal_mesa3d-1d2a844e7d55645ea3d24fb589bec03695b3d2b1.zip
external_mesa3d-1d2a844e7d55645ea3d24fb589bec03695b3d2b1.tar.gz
external_mesa3d-1d2a844e7d55645ea3d24fb589bec03695b3d2b1.tar.bz2
mesa/teximage: Add GL error parameter to _mesa_target_can_be_compressed
Enables _mesa_target_can_be_compressed to return the appropriate GL error depending on it's inputs. Use the parameter to return the appropriate GL error for ETC2 formats on GLES3. Suggested-by: Chad Versace <chad.versace@intel.com> Reviewed-by: Chad Versace <chad.versace@intel.com> Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Diffstat (limited to 'src/mesa/main/texstorage.c')
-rw-r--r--src/mesa/main/texstorage.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 51f49b3..c53bb29 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -308,22 +308,14 @@ tex_storage_error_check(struct gl_context *ctx,
return GL_TRUE;
}
- /* 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."
- *
- * This should also be applicable for glTexStorage3D().
- */
- if (_mesa_is_compressed_format(ctx, internalformat)
- && !_mesa_target_can_be_compressed(ctx, target, internalformat)) {
- _mesa_error(ctx, _mesa_is_desktop_gl(ctx)?
- GL_INVALID_ENUM : GL_INVALID_OPERATION,
+ if (_mesa_is_compressed_format(ctx, internalformat)) {
+ GLenum err;
+ if (!_mesa_target_can_be_compressed(ctx, target, internalformat, &err)) {
+ _mesa_error(ctx, err,
"glTex%sStorage%dD(internalformat = %s)", suffix, dims,
_mesa_enum_to_string(internalformat));
- return GL_TRUE;
+ return GL_TRUE;
+ }
}
/* levels check */