[Mesa-dev] [2/2] state_tracker: Handle texture view min level in st_generate_mipmap()

Ilia Mirkin imirkin at alum.mit.edu
Fri Nov 1 19:19:05 UTC 2019


It looks like the _mesa_generate_mipmap fallback has a similar problem
(which would happen for glGenerateMipmap with e.g. a s3tc format).

I think this could all use some piglit tests that iterate through all
or at least many different formats, including both renderable and
non-renderable ones.

Cheers,

  -ilia

On Fri, Nov 1, 2019 at 3:08 PM Paul Gofman <gofmanp at gmail.com> wrote:
>
> Signed-off-by: Paul Gofman <gofmanp at gmail.com>
> ---
>  src/mesa/state_tracker/st_gen_mipmap.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
> index b71a8ee57bb..c5cf7063836 100644
> --- a/src/mesa/state_tracker/st_gen_mipmap.c
> +++ b/src/mesa/state_tracker/st_gen_mipmap.c
> @@ -56,13 +56,16 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
>     struct st_context *st = st_context(ctx);
>     struct st_texture_object *stObj = st_texture_object(texObj);
>     struct pipe_resource *pt = st_get_texobj_resource(texObj);
> -   const uint baseLevel = texObj->BaseLevel;
> +   uint baseLevel = texObj->BaseLevel;
>     enum pipe_format format;
>     uint lastLevel, first_layer, last_layer;
>
>     if (!pt)
>        return;
>
> +   if (texObj->Immutable)
> +      baseLevel += texObj->MinLevel;
> +
>     /* not sure if this ultimately actually should work,
>        but we're not supporting multisampled textures yet. */
>     assert(pt->nr_samples < 2);
> --
> 2.23.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