summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_texture.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-09-28 11:15:01 -0700
committerEric Anholt <[email protected]>2011-10-03 13:29:38 -0700
commit5324f9c48d59ef966fbab03664a8d44ea8c19c5f (patch)
tree01db82cf91feb689fec8ecc80d8e077e891211b6 /src/mesa/swrast/s_texture.c
parentb07c78bfe94c17e6fccba70923b03a29c751fde1 (diff)
swrast: When asked to map a slice of a 1D array, give back that slice.
Until now, we've been treating 1D arrays as a single slice, and each array slice is actually just a row of the 2D texture. While swrast still stores them this way, hardware drivers think that 1D arrays have actual separate slices not stored as contiguous rows. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_texture.c')
-rw-r--r--src/mesa/swrast/s_texture.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index aa073753f43..36b429cfab9 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -177,6 +177,13 @@ _swrast_map_teximage(struct gl_context *ctx,
1);
assert(slice < texImage->Depth);
map += slice * sliceSize;
+ } else if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
+ GLuint sliceSize = _mesa_format_image_size(texImage->TexFormat,
+ texImage->Width,
+ 1,
+ 1);
+ assert(slice < texImage->Height);
+ map += slice * sliceSize;
}
/* apply x/y offset to map address */