[Mesa-dev] [PATCH 17/41] intel: Replace intel_mipmap_tree::hiz_region with a miptree

Eric Anholt eric at anholt.net
Fri Nov 18 15:24:10 PST 2011


On Thu, 17 Nov 2011 19:58:44 -0800, Chad Versace <chad.versace at linux.intel.com> wrote:
> This is required to correctly implement HiZ for mipmapped and
> multi-layered textures.
> 
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_misc_state.c     |    5 +++--
>  src/mesa/drivers/dri/intel/intel_context.c     |   20 ++++++++++----------
>  src/mesa/drivers/dri/intel/intel_fbo.c         |   11 +++--------
>  src/mesa/drivers/dri/intel/intel_mipmap_tree.c |   19 ++++++++++++++++++-
>  src/mesa/drivers/dri/intel/intel_mipmap_tree.h |   22 +++++++++++++---------
>  5 files changed, 47 insertions(+), 30 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
> index 4119afa..17da460 100644
> --- a/src/mesa/drivers/dri/i965/brw_misc_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c

> @@ -1394,17 +1394,17 @@ intel_process_dri2_buffer_with_separate_stencil(struct intel_context *intel,
>  				    buffer->pitch / buffer->cpp,
>  				    buffer->name,
>  				    buffer_name);
> -
> +   struct intel_mipmap_tree *mt =
> +      intel_miptree_create_for_region(intel,
> +				      GL_TEXTURE_2D,
> +				      rb->Base.Format,
> +				      region);
> +   intel_region_release(&region);
>     if (buffer->attachment == __DRI_BUFFER_HIZ) {
> -      intel_region_reference(&rb->mt->hiz_region, region);
> +      rb->mt->hiz_mt = mt;
>     } else {
> -      rb->mt = intel_miptree_create_for_region(intel,
> -                                               GL_TEXTURE_2D,
> -                                               rb->Base.Format,
> -                                               region);;
> +      rb->mt = mt;
>     }

I don't see who would have already released preexisting rb->mt here.

> +bool
> +intel_miptree_alloc_hiz(struct intel_context *intel,
> +			struct intel_mipmap_tree *mt)
> +{
> +   assert(mt->hiz_mt == NULL);
> +   mt->hiz_mt = intel_miptree_create(intel,
> +                                     mt->target,
> +                                     MESA_FORMAT_X8_Z24,
> +                                     mt->first_level,
> +                                     mt->last_level,
> +                                     mt->width0,
> +                                     mt->height0,
> +                                     mt->depth0,
> +                                     true);
> +   return mt->hiz_mt != NULL;
> +}

We don't get any size reduction on the hiz miptree compared to the real
miptree?
-------------- 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/20111118/d5644a48/attachment.pgp>


More information about the mesa-dev mailing list