mesa: Fix valid texture target test in _mesa_GetTexLevelParameteriv()
authorAnuj Phogat <anuj.phogat@gmail.com>
Fri, 2 Mar 2012 20:00:51 +0000 (12:00 -0800)
committerAnuj Phogat <anuj.phogat@gmail.com>
Tue, 6 Mar 2012 03:02:08 +0000 (19:02 -0800)
commita9523af0e88017d683c19ff238bfc5eb7cb88fd0
tree7162e60603e02adf850d37ceb16979f0b3f82849
parent71f4a960f8e034cc73aaa81b4343101d0046ffb3
mesa: Fix valid texture target test in _mesa_GetTexLevelParameteriv()

_mesa_max_texture_levels() is also used to test valid texture target
in _mesa_GetTexLevelParameteriv(). GL_TEXTURE_CUBE_MAP is not allowed
as texture target in glGetTexLevelParameter(). So, this should throw
GL_INVALID_ENUM error.

Few other functions which use _mesa_max_texture_levels() like
getcompressedteximage_error_check() and getteximage_error_check()
also don't accept GL_TEXTURE_CUBE_MAP.

Above fix makes piglit fbo-cubemap test to fail. This is because of
incorrect texture target passed to _mesa_max_texture_levels() in
framebuffer_texture(). Fixing that as well

Note: This is a candidate for the stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/fbobject.c
src/mesa/main/teximage.c