diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 87e13f5e62c..7fbb92a922f 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -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 */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 79e9aa9edab..b62c07e46f7 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -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);