[Mesa-dev] [PATCH V4 2/6] intel: create a miptree for a region based on an offset, size, and level.

Eric Anholt eric at anholt.net
Tue Jan 15 13:45:58 PST 2013


Abdiel Janulgue <abdiel.janulgue at linux.intel.com> writes:

> Add intel_miptree_create_for_offset which adds support for creating a single-
> level miptree based on the existing offsets and dimensions of another
> mip-tree level. Use this function as well in intel_miptree_create_for_region,
> but for the whole region.
>
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
> ---
>  src/mesa/drivers/dri/intel/intel_mipmap_tree.c |   39 +++++++++++++++++++++---
>  src/mesa/drivers/dri/intel/intel_mipmap_tree.h |   12 ++++++++
>  src/mesa/drivers/dri/intel/intel_regions.h     |    8 +++++
>  3 files changed, 54 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> index 8d814bd..0a64de4 100644
> --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> @@ -306,17 +306,26 @@ intel_miptree_create(struct intel_context *intel,
>  }
>  
>  
> +/**
> + * Create miptree for region based on offset, size, and level
> + */
>  struct intel_mipmap_tree *
> -intel_miptree_create_for_region(struct intel_context *intel,
> -				GLenum target,
> -				gl_format format,
> -				struct intel_region *region)
> +intel_miptree_create_for_offset(struct intel_context *intel,
> +                                GLenum target,
> +                                gl_format format,
> +                                struct intel_region *region,
> +                                GLuint width,
> +                                GLuint height,
> +                                GLuint level_x,
> +                                GLuint level_y,
> +                                GLuint slice_x_offset,
> +                                GLuint slice_y_offset)
>  {
>     struct intel_mipmap_tree *mt;
>  
>     mt = intel_miptree_create_internal(intel, target, format,
>  				      0, 0,
> -				      region->width, region->height, 1,
> +				      width, height, 1,
>  				      true, 0 /* num_samples */,
>                                        INTEL_MSAA_LAYOUT_NONE);

I'd probably skip this whole patch and just expose
intel_miptree_create_internal (perhaps called
intel_miptree_create_layout() instead of _internal() to clarify that it
doesn't do allocation?  Not sure.), then do the fixup in the
KHR_gl_texture_image function.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130115/36801232/attachment.pgp>


More information about the mesa-dev mailing list