[Mesa-dev] [PATCH mesa 1/2] radv: used designated initialisers in formats table

Eric Engestrom eric.engestrom at imgtec.com
Wed Jan 31 11:51:25 UTC 2018


Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
 src/amd/vulkan/vk_format_table.py | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/amd/vulkan/vk_format_table.py b/src/amd/vulkan/vk_format_table.py
index 36352b108d0b5220a901..f903e21f697dc42981ed 100644
--- a/src/amd/vulkan/vk_format_table.py
+++ b/src/amd/vulkan/vk_format_table.py
@@ -127,18 +127,20 @@ def do_swizzle_array(channels, swizzles):
     for format in formats:
         print 'const struct vk_format_description'
         print 'vk_format_%s_description = {' % (format.short_name(),)
-        print "   %s," % (format.name,)
-        print "   \"%s\"," % (format.name,)
-        print "   \"%s\"," % (format.short_name(),)
-        print "   {%u, %u, %u},\t/* block */" % (format.block_width, format.block_height, format.block_size())
-        print "   %s," % (layout_map(format.layout),)
-        print "   %u,\t/* nr_channels */" % (format.nr_channels(),)
-        print "   %s,\t/* is_array */" % (bool_map(format.is_array()),)
-        print "   %s,\t/* is_bitmask */" % (bool_map(format.is_bitmask()),)
-        print "   %s,\t/* is_mixed */" % (bool_map(format.is_mixed()),)
+        print "   .format = %s," % (format.name,)
+        print "   .name = \"%s\"," % (format.name,)
+        print "   .short_name = \"%s\"," % (format.short_name(),)
+        print "   .block = {%u, %u, %u}," % (format.block_width, format.block_height, format.block_size())
+        print "   .layout = %s," % (layout_map(format.layout),)
+        print "   .nr_channels = %u," % (format.nr_channels(),)
+        print "   .is_array = %s," % (bool_map(format.is_array()),)
+        print "   .is_bitmask = %s," % (bool_map(format.is_bitmask()),)
+        print "   .is_mixed = %s," % (bool_map(format.is_mixed()),)
+        print "   .channel = "
         print_channels(format, do_channel_array)
+        print "   .swizzle = "
         print_channels(format, do_swizzle_array)
-        print "   %s," % (colorspace_map(format.colorspace),)
+        print "   .colorspace = %s," % (colorspace_map(format.colorspace),)
         print "};"
         print
         
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list