[Mesa-dev] [PATCH v3 3/6] intel: add new miptree helper functions

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Fri Jan 11 06:27:26 PST 2013


Expose intel_miptree_copy_slice and add function calculating
x and y offsets of a miptree level within a tiled region.

Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |   17 ++++++++++++++++-
 src/mesa/drivers/dri/intel/intel_mipmap_tree.h |   13 +++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 0a64de4..5698dec 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -718,7 +718,22 @@ intel_miptree_get_image_offset(struct intel_mipmap_tree *mt,
    *y = mt->level[level].slice[slice].y_offset;
 }
 
-static void
+void
+intel_miptree_get_tile_offsets(struct intel_mipmap_tree *mt,
+                               GLuint level,
+                               uint32_t *tile_x,
+                               uint32_t *tile_y)
+{
+   struct intel_region *region = mt->region;
+   uint32_t mask_x, mask_y;
+
+   intel_region_get_tile_masks(region, &mask_x, &mask_y, false);
+
+   *tile_x = mt->level[level].level_x & mask_x;
+   *tile_y = mt->level[level].level_y & mask_y;
+}
+
+void
 intel_miptree_copy_slice(struct intel_context *intel,
 			 struct intel_mipmap_tree *dst_mt,
 			 struct intel_mipmap_tree *src_mt,
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
index 3e76753..0a2246e 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
@@ -460,6 +460,12 @@ void
 intel_miptree_get_dimensions_for_image(struct gl_texture_image *image,
                                        int *width, int *height, int *depth);
 
+void
+intel_miptree_get_tile_offsets(struct intel_mipmap_tree *mt,
+                               GLuint level,
+                               uint32_t *tile_x,
+                               uint32_t *tile_y);
+
 void intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
                                   GLuint level,
                                   GLuint x, GLuint y,
@@ -470,6 +476,13 @@ void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt,
                                     GLuint img, GLuint x, GLuint y);
 
 void
+intel_miptree_copy_slice(struct intel_context *intel,
+			 struct intel_mipmap_tree *dst_mt,
+			 struct intel_mipmap_tree *src_mt,
+			 int level,
+			 int face,
+			 int depth);
+void
 intel_miptree_copy_teximage(struct intel_context *intel,
                             struct intel_texture_image *intelImage,
                             struct intel_mipmap_tree *dst_mt);
-- 
1.7.9.5



More information about the mesa-dev mailing list