summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2007-12-28 18:03:39 -0800
committerEric Anholt <[email protected]>2007-12-28 18:05:22 -0800
commit3956597962dcf6c8082541199ebac58e0d84f6bc (patch)
tree0266a64936ca5a2c39c93526a7a318a7c350c0f8 /src/mesa
parentaecec3aced1375a8e15f88e13a5dfc97f2814ba4 (diff)
Bug #13839: Fix 3D texture offset miscalculation with pixels versus bytes.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.c6
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.h1
2 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 76375850331..97a82fe9d0f 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -358,7 +358,7 @@ intel_miptree_image_data(struct intel_context *intel,
height /= 4;
intel_region_data(intel,
dst->region,
- dst_offset + dst_depth_offset[i], /* dst_offset */
+ dst_offset + dst_depth_offset[i] * dst->cpp, /* dst_offset */
0, 0, /* dstx, dsty */
src,
src_row_pitch,
@@ -395,10 +395,10 @@ intel_miptree_image_copy(struct intel_context *intel,
for (i = 0; i < depth; i++) {
intel_region_copy(intel,
- dst->region, dst_offset + dst_depth_offset[i],
+ dst->region, dst_offset + dst_depth_offset[i] * dst->cpp,
0,
0,
- src->region, src_offset + src_depth_offset[i],
+ src->region, src_offset + src_depth_offset[i] * src->cpp,
0, 0, width, height);
}
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
index 968eec4fec3..e3b31f9c6e5 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
@@ -73,6 +73,7 @@ struct intel_mipmap_level
* are going to be so diverse that there is no unified way to
* compute the offsets of depth/cube images within a mipmap level,
* so have to store them as a lookup table:
+ * NOTE level_offset is a byte offset, but the image_offsets are _pixel_ offsets!!!
*/
GLuint *image_offset;
};