[Mesa-dev] [PATCH] st/mesa: fix regression since a22aba4eae9b29db731487bce90e8292f7e82c72

Brian Paul brian.e.paul at gmail.com
Sun Apr 24 11:31:20 PDT 2011


On Sun, Apr 24, 2011 at 1:45 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> "st/mesa: check image size before copy_image_data_to_texture()" caused
> a regression in piglit fbo-generatemipmap-formats test on all gallium drivers.

Sorry about that.  I ran the piglit texture tests but not the fbo
tests, apparently.


> Level 0 for NPOT textures will not match minified values, so don't do this
> check for level 0.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/mesa/state_tracker/st_cb_texture.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
> index ab7f6a5..9227eba 100644
> --- a/src/mesa/state_tracker/st_cb_texture.c
> +++ b/src/mesa/state_tracker/st_cb_texture.c
> @@ -1843,9 +1843,9 @@ st_finalize_texture(struct gl_context *ctx,
>          /* Need to import images in main memory or held in other textures.
>           */
>          if (stImage && stObj->pt != stImage->pt) {
> -            if (stImage->base.Width == u_minify(stObj->width0, level) &&
> +            if ((stImage->base.Width == u_minify(stObj->width0, level) &&
>                 stImage->base.Height == u_minify(stObj->height0, level) &&
> -                stImage->base.Depth == u_minify(stObj->depth0, level)) {
> +                stImage->base.Depth == u_minify(stObj->depth0, level)) || level == 0) {
>                /* src image fits expected dest mipmap level size */
>                copy_image_data_to_texture(st, stObj, level, stImage);
>             }

I'd probably put the level==0 part of the test first since it's a
common case and cheap to test.  But that's a minor nit pick.

Thanks for fixing this.

-Brian


More information about the mesa-dev mailing list