aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r--src/mesa/state_tracker/st_texture.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index af9b7675f10..c84aa4566b2 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -260,6 +260,12 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
else
level = stImage->base.Level;
+ if (stObj->base.Immutable) {
+ level += stObj->base.MinLevel;
+ z += stObj->base.MinLayer;
+ d = MIN2(d, stObj->base.NumLayers);
+ }
+
z += stImage->base.Face;
map = pipe_transfer_map_3d(st->pipe, stImage->pt, level, usage,
@@ -289,8 +295,13 @@ st_texture_image_unmap(struct st_context *st,
struct st_texture_image *stImage, unsigned slice)
{
struct pipe_context *pipe = st->pipe;
- struct pipe_transfer **transfer =
- &stImage->transfer[slice + stImage->base.Face].transfer;
+ struct st_texture_object *stObj =
+ st_texture_object(stImage->base.TexObject);
+ struct pipe_transfer **transfer;
+
+ if (stObj->base.Immutable)
+ slice += stObj->base.MinLayer;
+ transfer = &stImage->transfer[slice + stImage->base.Face].transfer;
DBG("%s\n", __FUNCTION__);