mesa: raise GL_INVALID_OPERATION in glGenerateMipmap for missing base image
authorBrian Paul <brianp@vmware.com>
Fri, 10 Aug 2012 16:36:17 +0000 (10:36 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 16 Aug 2012 15:11:14 +0000 (09:11 -0600)
This seems to be expected by the WebGL texture-mips test.  The error makes
sense, but I haven't found (yet) any OpenGL documentation specifying this
error condition.

See http://bugs.freedesktop.org/show_bug.cgi?id=44912

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/mesa/main/fbobject.c

index aa8ba1882cefad302d68da5c3dbd78193c29bb97..792a92da35c5c4d31fa0791caa810077286813a2 100644 (file)
@@ -2564,6 +2564,8 @@ _mesa_GenerateMipmapEXT(GLenum target)
    srcImage = _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel);
    if (!srcImage) {
       _mesa_unlock_texture(ctx, texObj);
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glGenerateMipmap(zero size base image)");
       return;
    }