[Mesa-dev] [PATCH] svga: fix max_lod clamping in update_tss_binding()

Jose Fonseca jfonseca at vmware.com
Wed Feb 29 07:07:15 PST 2012


Looks good. Thanks Brian.

Jose

----- Original Message -----
> After biasing we need to clamp to be sure we don't exceed the number
> of
> levels in the mipmap.  This fixes an assertion at
> svga_sampler_view.c:70
> 
> v2: simplify the biasing, clamping code per Jose's suggestion.
> ---
>  src/gallium/drivers/svga/svga_state_tss.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/svga/svga_state_tss.c
> b/src/gallium/drivers/svga/svga_state_tss.c
> index 8eb0dbf..d5ed804 100644
> --- a/src/gallium/drivers/svga/svga_state_tss.c
> +++ b/src/gallium/drivers/svga/svga_state_tss.c
> @@ -87,8 +87,8 @@ update_tss_binding(struct svga_context *svga,
>        /* get min max lod */
>        if (sv) {
>           min_lod = MAX2(0, (s->view_min_lod +
>           sv->u.tex.first_level));
> -         max_lod = MIN2(s->view_max_lod, sv->texture->last_level);
> -         max_lod += sv->u.tex.first_level;
> +         max_lod = MIN2(s->view_max_lod + sv->u.tex.first_level,
> +                        sv->texture->last_level);
>           texture = sv->texture;
>        } else {
>           min_lod = 0;
> --
> 1.7.3.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list