From: Lionel Landwerlin Date: Fri, 15 Sep 2017 14:10:55 +0000 (+0100) Subject: vulkan: enum generator: sort enums by names X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=935b42d9bc92db11a1b0d471c6de368b49a1604c;p=mesa.git vulkan: enum generator: sort enums by names Signed-off-by: Lionel Landwerlin Reviewed-by: Jason Ekstrand Reviewed-by: Chad Versace Reviewed-by: Dylan Baker --- diff --git a/src/vulkan/util/gen_enum_to_str.py b/src/vulkan/util/gen_enum_to_str.py index aa7001ef13f..c615ed08c48 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) 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))