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.
This commit is contained in:
Brian Paul
2004-11-10 15:46:52 +00:00
parent f00d7edd74
commit 60909388ab
20 changed files with 308 additions and 226 deletions

View File

@@ -429,7 +429,8 @@ _mesa_init_buffer_objects( GLcontext *ctx )
* go out of bounds.
*/
GLboolean
_mesa_validate_pbo_access(const struct gl_pixelstore_attrib *pack,
_mesa_validate_pbo_access(GLuint dimensions,
const struct gl_pixelstore_attrib *pack,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type, const GLvoid *ptr)
{
@@ -442,11 +443,11 @@ _mesa_validate_pbo_access(const struct gl_pixelstore_attrib *pack,
return GL_FALSE;
/* get address of first pixel we'll read */
start = _mesa_image_address(pack, ptr, width, height,
start = _mesa_image_address(dimensions, pack, ptr, width, height,
format, type, 0, 0, 0);
/* get address just past the last pixel we'll read */
end = _mesa_image_address(pack, ptr, width, height,
end = _mesa_image_address(dimensions, pack, ptr, width, height,
format, type, depth-1, height-1, width);