diff options
author | Anuj Phogat <[email protected]> | 2014-05-30 16:24:39 -0700 |
---|---|---|
committer | Anuj Phogat <[email protected]> | 2014-08-04 17:11:10 -0700 |
commit | e27c9f3a02509fe59db7ec409a339cc5ea809600 (patch) | |
tree | 17ac3602d9b64b747ab84f94b0bc56d8f16a306a /src | |
parent | ac2adf66c1ce009fed9175c891f4d90c6d79b7ab (diff) |
mesa: Add error condition for using compressed internalformat in glTexStorage3D()
Fixes gles3 Khronos CTS test: texture_storage_texture_internal_formats
Cc: <[email protected]>
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/texstorage.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c index 44b5374fdbd..897d5891a87 100644 --- a/src/mesa/main/texstorage.c +++ b/src/mesa/main/texstorage.c @@ -41,6 +41,7 @@ #include "texstorage.h" #include "textureview.h" #include "mtypes.h" +#include "glformats.h" @@ -301,6 +302,23 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target, 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, + "glTexStorage3D(internalformat = %s)", + _mesa_lookup_enum_by_nr(internalformat)); + } + /* levels check */ if (levels < 1) { _mesa_error(ctx, GL_INVALID_VALUE, "glTexStorage%uD(levels < 1)", |