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:
@@ -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);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user