mesa: remove redundant format/type checks in glGetTexImage()

The _mesa_error_check_format_and_type() function will catch all those
cases now.

Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Brian Paul
2012-02-07 07:42:33 -07:00
parent 627b435dfe
commit 8b3a517673
-34
View File
@@ -746,40 +746,6 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
return GL_TRUE;
}
if (_mesa_sizeof_packed_type(type) <= 0) {
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexImage(type)" );
return GL_TRUE;
}
if (_mesa_components_in_format(format) <= 0 ||
format == GL_STENCIL_INDEX ||
format == GL_COLOR_INDEX) {
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexImage(format)" );
return GL_TRUE;
}
if (!ctx->Extensions.ARB_depth_texture && _mesa_is_depth_format(format)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
return GL_TRUE;
}
if (!ctx->Extensions.MESA_ycbcr_texture && _mesa_is_ycbcr_format(format)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
return GL_TRUE;
}
if (!ctx->Extensions.EXT_packed_depth_stencil
&& _mesa_is_depthstencil_format(format)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
return GL_TRUE;
}
if (!ctx->Extensions.ATI_envmap_bumpmap
&& _mesa_is_dudv_format(format)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
return;
}
err = _mesa_error_check_format_and_type(ctx, format, type);
if (err != GL_NO_ERROR) {
_mesa_error(ctx, err, "glGetTexImage(format/type)");