added ImageStride field to gl_texture_image

This commit is contained in:
Brian Paul 2006-03-17 18:11:09 +00:00
parent 9cf0ed6059
commit cead52ef68
2 changed files with 6 additions and 2 deletions

View file

@ -1230,6 +1230,7 @@ struct gl_texture_image
GLuint Height; /**< = 2^HeightLog2 + 2*Border */
GLuint Depth; /**< = 2^DepthLog2 + 2*Border */
GLuint RowStride; /**< == Width unless IsClientData and padded */
GLuint ImageStride; /**< Stride between images, in texels */
GLuint Width2; /**< = Width - 2*Border */
GLuint Height2; /**< = Height - 2*Border */
GLuint Depth2; /**< = Depth - 2*Border */

View file

@ -115,6 +115,7 @@ static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img)
_mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
data += (img->RowStride - img->Width) * c;
}
/* XXX use img->ImageStride here */
_mesa_printf("\n");
}
#endif
@ -1038,6 +1039,7 @@ clear_teximage_fields(struct gl_texture_image *img)
img->Height = 0;
img->Depth = 0;
img->RowStride = 0;
img->ImageStride = 0;
img->Width2 = 0;
img->Height2 = 0;
img->Depth2 = 0;
@ -1083,6 +1085,7 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
img->Height = height;
img->Depth = depth;
img->RowStride = width;
img->ImageStride = width * height;
img->Width2 = width - 2 * border; /* == 1 << img->WidthLog2; */
img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
img->Depth2 = depth - 2 * border; /* == 1 << img->DepthLog2; */
@ -2003,8 +2006,8 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
GLenum type, GLvoid *pixels )
{
const struct gl_texture_unit *texUnit;
const struct gl_texture_object *texObj;
const struct gl_texture_image *texImage;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLint maxLevels = 0;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);