[Mesa-dev] [PATCH v3 2/6] vulkan: enum generator: sort enums by names

Chad Versace chadversary at chromium.org
Fri Sep 22 00:15:09 UTC 2017


On Thu 21 Sep 2017, Jason Ekstrand wrote:
> From: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> 
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/vulkan/util/gen_enum_to_str.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/vulkan/util/gen_enum_to_str.py b/src/vulkan/util/gen_enum_to_str.py
> index aa7001e..efe5d4f 100644
> --- a/src/vulkan/util/gen_enum_to_str.py
> +++ b/src/vulkan/util/gen_enum_to_str.py
> @@ -185,13 +185,14 @@ def main():
>      efactory = EnumFactory(VkEnum)
>      for filename in args.xml_files:
>          parse_xml(efactory, filename)
> +    enums=sorted(efactory.registry.values(), key=lambda e: e.name)

Minor nit. The above = should have spaces around it.

Reviewed-by: Chad Versace <chadversary at chromium.org>


>  
>      for template, file_ in [(C_TEMPLATE, os.path.join(args.outdir, 'vk_enum_to_str.c')),
>                              (H_TEMPLATE, os.path.join(args.outdir, 'vk_enum_to_str.h'))]:
>          with open(file_, 'wb') as f:
>              f.write(template.render(
>                  file=os.path.basename(__file__),
> -                enums=efactory.registry.values(),
> +                enums=enums,
>                  copyright=COPYRIGHT,
>                  FOREIGN_ENUM_VALUES=FOREIGN_ENUM_VALUES))
>  
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> 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