[Mesa-dev] [PATCH 1/2] st/mesa: only minify height if target != 1D array in st_finalize_texture

Ilia Mirkin imirkin at alum.mit.edu
Sun Mar 27 22:38:14 UTC 2016


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

I was too concentrated on fixing those array piglits to think of this
issue :) I do wonder why dEQP doesn't hit it... i guess 1d arrays
aren't a thing in GLES? Either way, this seems right.

On Sun, Mar 27, 2016 at 2:25 PM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> The st_texture_object documentation says:
>   "the number of 1D array layers will be in height0"
>
> We can't minify that.
>
> Spotted by luck. No app is known to hit this issue.
> ---
>  src/mesa/state_tracker/st_cb_texture.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
> index 460c179..3980f5d 100644
> --- a/src/mesa/state_tracker/st_cb_texture.c
> +++ b/src/mesa/state_tracker/st_cb_texture.c
> @@ -2886,12 +2886,17 @@ 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) {
> +            GLuint height = stObj->height0;
>              GLuint depth = stObj->depth0;
> +
> +            if (stObj->base.Target != GL_TEXTURE_1D_ARRAY)
> +               height = u_minify(height, level);
>              if (stObj->base.Target == GL_TEXTURE_3D)
>                 depth = u_minify(depth, level);
> +
>              if (level == 0 ||
>                  (stImage->base.Width == u_minify(stObj->width0, level) &&
> -                 stImage->base.Height == u_minify(stObj->height0, level) &&
> +                 stImage->base.Height == height &&
>                   stImage->base.Depth == depth)) {
>                 /* src image fits expected dest mipmap level size */
>                 copy_image_data_to_texture(st, stObj, level, stImage);
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list