From b0b6d1abe5c7e629baebd4bf3d3ee3b17ba6ff08 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 20 May 2006 16:19:48 +0000 Subject: In gl_texture_image, replace ImageStride with an ImageOffsets array. Some hardware lays out 3D mipmaps in a manner that can't be expressed with a simple image stride. The ImageOffsets array is allocated and initialized to typical defaults in the _mesa_init_teximage_fields() function. If needed, a driver will then have to replace these offsets. TexStore and TexelFetch routines updated to use offsets array. --- src/mesa/main/texformat_tmp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/main/texformat_tmp.h') diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 1c41278059..186fe23514 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -59,8 +59,8 @@ #elif DIM == 3 #define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((type *)(image)->Data + (((image)->Height * (k) + (j)) * \ - (image)->RowStride + (i)) * (size)) + ((type *)(image)->Data + ((image)->ImageOffsets[k] \ + + (image)->RowStride * (j) + (i)) * (size)) #define FETCH(x) fetch_texel_3d_##x -- cgit v1.2.3