[Mesa-dev] [PATCH] build: Fix string matching

Eric Engestrom eric.engestrom at intel.com
Thu Jul 5 10:47:25 UTC 2018


On Thursday, 2018-07-05 12:43:04 +0200, Mathieu Bridon wrote:
> Commit f69bc797e15fe6beb9e439009fab55f7fae0b7f9 did the following:
> 
> -        if format.layout in ('bptc', 'astc'):
> +        if format.layout in ('astc'):
> 
> The intention was to go from matching either 'bptc' or 'astc' to
> matching only 'astc'.
> 
> But the new code doesn't respect this intention any more, because in
> Python `('astc')` is not a tuple containing a string, it is just the
> string. (the parentheses are simply ignored)
> 
> That means we now match any substring of 'astc', for example 'a'.
> 
> This commit fixes the test to respect the original intention.

Fixes: f69bc797e15fe6beb9e4 "gallium/auxiliary: Add helper support for
                             bptc format compress/decompress"
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>

> ---
>  src/gallium/auxiliary/util/u_format_table.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py
> index 1f8e15fa97..a9df984994 100644
> --- a/src/gallium/auxiliary/util/u_format_table.py
> +++ b/src/gallium/auxiliary/util/u_format_table.py
> @@ -139,7 +139,7 @@ def write_format_table(formats):
>          u_format_pack.print_channels(format, do_swizzle_array)
>          print "   %s," % (colorspace_map(format.colorspace),)
>          access = True
> -        if format.layout in ('astc'):
> +        if format.layout == 'astc':
>              access = False
>          if format.layout == 'etc' and format.short_name() != 'etc1_rgb8':
>              access = False
> -- 
> 2.17.1
> 
> _______________________________________________
> 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