[Mesa-dev] [PATCH] st/mesa: Fix source miptree level for copying data to finalized miptree.

Brian Paul brianp at vmware.com
Fri Oct 19 07:43:27 PDT 2012


On 10/19/2012 08:00 AM, Michel Dänzer wrote:
> From: Michel Dänzer<michel.daenzer at amd.com>
>
> Fixes WebGL texture mips conformance test, no piglit regressions.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44912
>
> NOTE: This is a candidate for the stable branches.
>
> Signed-off-by: Michel Dänzer<michel.daenzer at amd.com>
> ---
>   src/mesa/state_tracker/st_cb_texture.c |   12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
> index 218c8d1..d947836 100644
> --- a/src/mesa/state_tracker/st_cb_texture.c
> +++ b/src/mesa/state_tracker/st_cb_texture.c
> @@ -1112,12 +1112,16 @@ copy_image_data_to_texture(struct st_context *st,
>      if (stImage->pt) {
>         /* Copy potentially with the blitter:
>          */
> -      GLuint src_level;
> -      if (stImage->pt != stObj->pt)
> -         src_level = 0;
> -      else
> +      GLuint src_level = 0;
> +
> +      if (stImage->pt->last_level>  0) {
>            src_level = stImage->base.Level;
>
> +         assert(src_level<= stImage->pt->last_level);
> +         assert(u_minify(stImage->pt->width0, src_level) == stImage->base.Width);
> +         assert(u_minify(stImage->pt->height0, src_level) == stImage->base.Height);
> +      }
> +
>         st_texture_image_copy(st->pipe,
>                               stObj->pt, dstLevel,  /* dest texture, level */
>                               stImage->pt, src_level, /* src texture, level */


LGTM.  Thanks for fixing this one.  I assume there's no piglit 
regressions.

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list