summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-10-04 18:26:39 -0600
committerBrian Paul <[email protected]>2011-10-05 21:06:47 -0600
commit5253cf98057dad54e25b4b8c36f8cf24f559314c (patch)
treee3eae8ee98685f9a1795e3d301680e96871d651a /src/mesa/drivers/dri/radeon
parentc3ef232315a4e9c18b3d812dbb28ffac6830d6f8 (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 6bd89671083..24e40e9853b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -785,11 +785,19 @@ static void radeon_store_teximage(struct gl_context* ctx, int dims,
copy_rows(img_start, dstRowStride, pixels, srcRowStride, rows, bytesPerRow);
}
else {
+ GLubyte *slices[512];
+ GLuint texelBytes = _mesa_get_format_bytes(texImage->TexFormat);
+ GLuint i;
+ assert(depth <= 512);
+ for (i = 0; i < depth; i++) {
+ slices[i] = (GLubyte *) texImage->Data
+ + dstImageOffsets[i] * texelBytes;
+ }
if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat,
- texImage->TexFormat, texImage->Data,
+ texImage->TexFormat,
xoffset, yoffset, zoffset,
dstRowStride,
- dstImageOffsets,
+ slices,
width, height, depth,
format, type, pixels, packing)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");