aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texgetimage.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-09 08:46:41 +0100
committermarha <marha@users.sourceforge.net>2012-02-09 08:46:41 +0100
commit535951cba015f2a2b63292e0ca983d0d6e736b71 (patch)
tree8c0e0364a27f250e926abe165b82ca12e5a841bf /mesalib/src/mesa/main/texgetimage.c
parentebb6162f9cbc1af0fac0b670b5aa38c8bb7a7446 (diff)
parent474621addc25cb22865c54b70ffbec07c82eb04c (diff)
downloadvcxsrv-535951cba015f2a2b63292e0ca983d0d6e736b71.tar.gz
vcxsrv-535951cba015f2a2b63292e0ca983d0d6e736b71.tar.bz2
vcxsrv-535951cba015f2a2b63292e0ca983d0d6e736b71.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/texgetimage.c')
-rw-r--r--mesalib/src/mesa/main/texgetimage.c44
1 files changed, 4 insertions, 40 deletions
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c
index 42495c8c7..bff003d24 100644
--- a/mesalib/src/mesa/main/texgetimage.c
+++ b/mesalib/src/mesa/main/texgetimage.c
@@ -734,7 +734,7 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage;
const GLint maxLevels = _mesa_max_texture_levels(ctx, target);
const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2;
- GLenum baseFormat;
+ GLenum baseFormat, err;
if (maxLevels == 0) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(target=0x%x)", target);
@@ -746,37 +746,9 @@ 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)");
+ err = _mesa_error_check_format_and_type(ctx, format, type);
+ if (err != GL_NO_ERROR) {
+ _mesa_error(ctx, err, "glGetTexImage(format/type)");
return GL_TRUE;
}
@@ -787,14 +759,6 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
return GL_TRUE;
}
- if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
- /* GL_INVALID_OPERATION is generated by a format/type
- * mismatch (see the 1.2 spec page 94, sec 3.6.4.)
- */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(target)");
- return GL_TRUE;
- }
-
texImage = _mesa_select_tex_image(ctx, texObj, target, level);
if (!texImage) {
/* non-existant texture image */