GLuint srcImageStride = _mesa_image_image_stride(unpack, width, height,
format, type);
int i;
+ const GLubyte *src = (const GLubyte *) pixels;
for (i = 0; i++ < depth;) {
if (!texImage->TexFormat->StoreImage(ctx, dims,
dstRowStride,
texImage->ImageOffsets,
width, height, 1,
- format, type, pixels, unpack)) {
+ format, type, src, unpack)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
}
if (stImage->pt && i < depth) {
st_texture_image_unmap(stImage);
texImage->Data = st_texture_image_map(ctx->st, stImage, i);
- pixels += srcImageStride;
+ src += srcImageStride;
}
}
}
type);
GLuint depth;
int i;
+ GLubyte *dest;
/* Map */
if (stImage->pt) {
depth = texImage->Depth;
texImage->Depth = 1;
+ dest = (GLubyte *) pixels;
+
for (i = 0; i++ < depth;) {
if (compressed) {
- _mesa_get_compressed_teximage(ctx, target, level, pixels,
+ _mesa_get_compressed_teximage(ctx, target, level, dest,
texObj, texImage);
} else {
- _mesa_get_teximage(ctx, target, level, format, type, pixels,
+ _mesa_get_teximage(ctx, target, level, format, type, dest,
texObj, texImage);
}
if (stImage->pt && i < depth) {
st_texture_image_unmap(stImage);
texImage->Data = st_texture_image_map(ctx->st, stImage, i);
- pixels += dstImageStride;
+ dest += dstImageStride;
}
}
GLuint srcImageStride = _mesa_image_image_stride(packing, width, height,
format, type);
int i;
+ const GLubyte *src;
DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(target),
dstRowStride = stImage->surface->pitch * stImage->surface->cpp;
}
+ src = (const GLubyte *) pixels;
+
for (i = 0; i++ < depth;) {
if (!texImage->TexFormat->StoreImage(ctx, dims, texImage->_BaseFormat,
texImage->TexFormat,
dstRowStride,
texImage->ImageOffsets,
width, height, 1,
- format, type, pixels, packing)) {
+ format, type, src, packing)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "st_TexSubImage");
}
if (stImage->pt && i < depth) {
st_texture_image_unmap(stImage);
texImage->Data = st_texture_image_map(ctx->st, stImage, zoffset + i);
- pixels += srcImageStride;
+ src += srcImageStride;
}
}