mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 16:50:10 +01:00
intel: add pixel offset calculator for miptree levels
Add helper to calculate fine-grained x and y adjustment pixels to an image within a miptree level for tiled regions. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
This commit is contained in:
parent
7014df0d1d
commit
163b35e416
2 changed files with 21 additions and 0 deletions
|
|
@ -687,6 +687,21 @@ intel_miptree_get_image_offset(struct intel_mipmap_tree *mt,
|
|||
*y = mt->level[level].slice[slice].y_offset;
|
||||
}
|
||||
|
||||
void
|
||||
intel_miptree_get_tile_offsets(struct intel_mipmap_tree *mt,
|
||||
GLuint level, GLuint slice,
|
||||
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].slice[slice].x_offset & mask_x;
|
||||
*tile_y = mt->level[level].slice[slice].y_offset & mask_y;
|
||||
}
|
||||
|
||||
static void
|
||||
intel_miptree_copy_slice(struct intel_context *intel,
|
||||
struct intel_mipmap_tree *dst_mt,
|
||||
|
|
|
|||
|
|
@ -467,6 +467,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, GLuint slice,
|
||||
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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue