summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_mipmap_tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_mipmap_tree.c')
-rw-r--r--src/mesa/state_tracker/st_mipmap_tree.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_mipmap_tree.c b/src/mesa/state_tracker/st_mipmap_tree.c
index e99cd987e8..6293cc8f51 100644
--- a/src/mesa/state_tracker/st_mipmap_tree.c
+++ b/src/mesa/state_tracker/st_mipmap_tree.c
@@ -179,7 +179,7 @@ st_miptree_depth_offsets(struct pipe_mipmap_tree *mt, GLuint level)
GLuint
-st_miptree_image_offset(struct pipe_mipmap_tree * mt,
+st_miptree_image_offset(const struct pipe_mipmap_tree * mt,
GLuint face, GLuint level)
{
if (mt->target == GL_TEXTURE_CUBE_MAP_ARB)
@@ -190,6 +190,17 @@ st_miptree_image_offset(struct pipe_mipmap_tree * mt,
}
+GLuint
+st_miptree_texel_offset(const struct pipe_mipmap_tree * mt,
+ GLuint face, GLuint level,
+ GLuint col, GLuint row, GLuint img)
+{
+ GLuint imgOffset = st_miptree_image_offset(mt, face, level);
+
+ return imgOffset + row * (mt->pitch + col) * mt->cpp;
+}
+
+
/**
* Map a teximage in a mipmap tree.