mesa: raise GL_INVALID_OPERATION in glGenerateMipmap for missing base image

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>
This commit is contained in:
Brian Paul
2012-08-10 10:36:17 -06:00
parent d663a557fd
commit f6b7157550

View 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;
}