mesa: fix compressed_subtexture_error_check() return value
authorBrian Paul <brianp@vmware.com>
Fri, 15 Aug 2014 22:55:40 +0000 (16:55 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 16 Aug 2014 12:48:45 +0000 (06:48 -0600)
The function should return GLboolean, not GLenum.
If we detect invalid compressed pixel storage parameters, we should
return GL_TRUE, not GL_FALSE so that the function is no-op'd.
An update to the piglit s3tc-errors test will check this.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/main/teximage.c

index 4414a66182a2af6a51631cb4e3f419b73923b8ef..647d28ab3d19e3c9ef5a89e044da72ad39a3716a 100644 (file)
@@ -4182,9 +4182,9 @@ out:
 
 /**
  * Error checking for glCompressedTexSubImage[123]D().
- * \return error code or GL_NO_ERROR.
+ * \return GL_TRUE if error, GL_FALSE if no error
  */
-static GLenum
+static GLboolean
 compressed_subtexture_error_check(struct gl_context *ctx, GLint dims,
                                   GLenum target, GLint level,
                                   GLint xoffset, GLint yoffset, GLint zoffset,
@@ -4246,7 +4246,7 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims,
    if (!_mesa_compressed_pixel_storage_error_check(ctx, dims,
                                                 &ctx->Unpack,
                                                 "glCompressedTexSubImage")) {
-      return GL_FALSE;
+      return GL_TRUE;
    }
 
    expectedSize = compressed_tex_size(width, height, depth, format);