[Mesa-dev] [PATCH 7/9] i965: Always allocate validated miptrees from level 0.

Chad Versace chad.versace at linux.intel.com
Fri Sep 27 15:50:32 PDT 2013


On 09/18/2013 12:59 PM, Eric Anholt wrote:
> No change in copies during a piglit run, but it's one less first_level !=
> 0 in our codebase.
> ---
>   src/mesa/drivers/dri/i965/intel_tex_validate.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c
> index 42533bb..e44c3ca 100644
> --- a/src/mesa/drivers/dri/i965/intel_tex_validate.c
> +++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c
> @@ -99,16 +99,15 @@ intel_finalize_mipmap_tree(struct brw_context *brw, GLuint unit)
>         intel_miptree_get_dimensions_for_image(&firstImage->base.Base,
>   					     &width, &height, &depth);
>
> -      perf_debug("Creating new %s %dx%dx%d %d..%d miptree to handle finalized "
> -                 "texture miptree.\n",
> +      perf_debug("Creating new %s %dx%dx%d %d-level miptree to handle "
> +                 "finalized texture miptree.\n",
>                    _mesa_get_format_name(firstImage->base.Base.TexFormat),
> -                 width, height, depth,
> -                 validate_first_level, validate_last_level);
> +                 width, height, depth, validate_last_level + 1);
>
>         intelObj->mt = intel_miptree_create(brw,
>                                             intelObj->base.Target,
>   					  firstImage->base.Base.TexFormat,
> -                                          validate_first_level,
> +                                          0, /* first_level */
>                                             validate_last_level,
>                                             width,
>                                             height,
>


Yes please. The possibility of mt->first_level != 0 always confuses me.
One less occurrence is welcome.
Reviewed-by: Chad Versace <chad.versace at linux.intel.com>


More information about the mesa-dev mailing list