[Mesa-dev] [PATCH 1/5] i965: Remove tile_x and tile_y dependency in DRIImage
Abdiel Janulgue
abdiel.janulgue at linux.intel.com
Mon Dec 9 08:03:30 PST 2013
We don't need this and the hardware allows us to sample directly from
a mipmap's specific level and layer. We can simplify
the operation by adding a level field in DRIImage instead.
Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
src/mesa/drivers/dri/i965/intel_regions.h | 3 +--
src/mesa/drivers/dri/i965/intel_screen.c | 20 +++-----------------
2 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/intel_regions.h b/src/mesa/drivers/dri/i965/intel_regions.h
index 366950a..1de18ca 100644
--- a/src/mesa/drivers/dri/i965/intel_regions.h
+++ b/src/mesa/drivers/dri/i965/intel_regions.h
@@ -145,10 +145,9 @@ struct __DRIimageRec {
struct intel_image_format *planar_format;
/* particular miptree level */
+ GLuint level;
GLuint width;
GLuint height;
- GLuint tile_x;
- GLuint tile_y;
bool has_depthstencil;
/**
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 4373685..19c5f96 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -327,19 +327,9 @@ intel_setup_image_from_mipmap_tree(struct brw_context *brw, __DRIimage *image,
intel_miptree_check_level_layer(mt, level, zoffset);
- intel_region_get_tile_masks(mt->region, &mask_x, &mask_y, false);
- intel_miptree_get_image_offset(mt, level, zoffset, &draw_x, &draw_y);
-
- image->width = mt->level[level].width;
- image->height = mt->level[level].height;
- image->tile_x = draw_x & mask_x;
- image->tile_y = draw_y & mask_y;
-
- image->offset = intel_region_get_aligned_offset(mt->region,
- draw_x & ~mask_x,
- draw_y & ~mask_y,
- false);
-
+ image->level = level;
+ image->width = mt->logical_width0;
+ image->height = mt->logical_height0;
intel_region_reference(&image->region, mt->region);
}
@@ -348,8 +338,6 @@ intel_setup_image_from_dimensions(__DRIimage *image)
{
image->width = image->region->width;
image->height = image->region->height;
- image->tile_x = 0;
- image->tile_y = 0;
image->has_depthstencil = false;
}
@@ -580,8 +568,6 @@ intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
image->offset = orig_image->offset;
image->width = orig_image->width;
image->height = orig_image->height;
- image->tile_x = orig_image->tile_x;
- image->tile_y = orig_image->tile_y;
image->has_depthstencil = orig_image->has_depthstencil;
image->data = loaderPrivate;
--
1.7.9.5
More information about the mesa-dev
mailing list