From: Brian Paul Date: Sat, 22 Sep 2012 15:30:23 +0000 (-0600) Subject: mesa: fix incorrect error for glCompressedSubTexImage X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1f586684d62c4f5208d1f3929d067a79ea2140ac;p=mesa.git mesa: fix incorrect error for glCompressedSubTexImage If a subtexture region isn't aligned to the compressed block size, return GL_INVALID_OPERATION, not gl_INVALID_VALUE. NOTE: This is a candidate for the stable branches. Reviewed-by: Eric Anholt --- diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 08af6689376..c22e853c5de 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3574,13 +3574,13 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dimensions, get_compressed_block_size(format, &bw, &bh); if ((xoffset % bw != 0) || (yoffset % bh != 0)) - return GL_INVALID_VALUE; + return GL_INVALID_OPERATION; if ((width % bw != 0) && width != 2 && width != 1) - return GL_INVALID_VALUE; + return GL_INVALID_OPERATION; if ((height % bh != 0) && height != 2 && height != 1) - return GL_INVALID_VALUE; + return GL_INVALID_OPERATION; expectedSize = compressed_tex_size(width, height, depth, format); if (expectedSize != imageSize)