From 5253cf98057dad54e25b4b8c36f8cf24f559314c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 4 Oct 2011 18:26:39 -0600 Subject: mesa: get rid of imageOffsets arrays in texstore code These were used to find the start of a 3D image slice (or 2D array texture slice) given a base address. Instead, use a simple array of address of image slices instead. This is a step toward getting rid of the gl_texture_image::ImageOffsets field. Reviewed-by: Eric Anholt --- src/mesa/state_tracker/st_cb_drawpixels.c | 4 +--- src/mesa/state_tracker/st_cb_texture.c | 9 +++------ 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 390c518699f..74e87f0e446 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -494,7 +494,6 @@ make_texture(struct st_context *st, { struct pipe_transfer *transfer; - static const GLuint dstImageOffsets = 0; GLboolean success; GLubyte *dest; const GLbitfield imageTransferStateSave = ctx->_ImageTransferState; @@ -517,10 +516,9 @@ make_texture(struct st_context *st, success = _mesa_texstore(ctx, 2, /* dims */ baseInternalFormat, /* baseInternalFormat */ mformat, /* gl_format */ - dest, /* dest */ 0, 0, 0, /* dstX/Y/Zoffset */ transfer->stride, /* dstRowStride, bytes */ - &dstImageOffsets, /* dstImageOffsets */ + &dest, /* destSlices */ width, height, 1, /* size */ format, type, /* src format/type */ pixels, /* data source */ diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 76bf78bbf0d..76574feffc0 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -803,10 +803,9 @@ st_TexImage(struct gl_context * ctx, if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat, texImage->TexFormat, - texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ dstRowStride, - texImage->ImageOffsets, + (GLubyte **) &texImage->Data, /* dstSlice */ width, height, 1, format, type, src, unpack)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); @@ -1091,10 +1090,9 @@ st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level, for (i = 0; i < depth; i++) { if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat, texImage->TexFormat, - texImage->Data, 0, 0, 0, dstRowStride, - texImage->ImageOffsets, + (GLubyte **) &texImage->Data, width, height, 1, format, type, src, packing)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); @@ -1356,10 +1354,9 @@ fallback_copy_texsubimage(struct gl_context *ctx, GLenum target, GLint level, _mesa_texstore(ctx, dims, texImage->_BaseFormat, texImage->TexFormat, - texDest, 0, 0, 0, dstRowStride, - texImage->ImageOffsets, + (GLubyte **) &texDest, width, height, 1, GL_RGBA, GL_FLOAT, tempSrc, /* src */ &unpack); -- cgit v1.2.3