diff options
author | Brian Paul <[email protected]> | 2004-11-10 15:46:52 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-11-10 15:46:52 +0000 |
commit | 60909388ab136d849d99eab49e782a53772a618f (patch) | |
tree | 84a981ea2e79b5e6477d05991119a23efa4429a5 /src/mesa/main/teximage.c | |
parent | f00d7edd746e4d1eec2d497419f21fb3b04f8bd4 (diff) |
GL_(UN)PACK_SKIP_IMAGES should only be applied to 3D texture pack/unpacking
and ignored for 1D and 2D images.
Need to pass in image dimensions (1,2,3) to the _mesa_image_address() function.
This change gets propogated to some other routines.
Also added new _mesa_image_address[123]d() convenience functions.
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 4d8780d3ba1..3e0ab88f2f6 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1901,6 +1901,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, const struct gl_texture_object *texObj; const struct gl_texture_image *texImage; GLint maxLevels = 0; + GLuint dimensions; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -1975,6 +1976,8 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, return; } + dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; + /* XXX - someday the rest of this function should be moved into a * fallback routine called via ctx->Driver.GetTexImage() */ @@ -1982,7 +1985,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, if (ctx->Pack.BufferObj->Name) { /* pack texture image into a PBO */ GLubyte *buf; - if (!_mesa_validate_pbo_access(&ctx->Pack, texImage->Width, + if (!_mesa_validate_pbo_access(dimensions, &ctx->Pack, texImage->Width, texImage->Height, texImage->Depth, format, type, pixels)) { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -2015,7 +2018,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, for (img = 0; img < depth; img++) { for (row = 0; row < height; row++) { /* compute destination address in client memory */ - GLvoid *dest = _mesa_image_address( &ctx->Pack, pixels, + GLvoid *dest = _mesa_image_address( dimensions, &ctx->Pack, pixels, width, height, format, type, img, row, 0); assert(dest); |