util: Add the shortened format name to the description.
authorJosé Fonseca <jfonseca@vmware.com>
Sat, 6 Mar 2010 12:46:29 +0000 (12:46 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 6 Mar 2010 12:46:29 +0000 (12:46 +0000)
src/gallium/auxiliary/util/u_format.h
src/gallium/auxiliary/util/u_format_table.py

index e8fa0022b5b54eb707f95e8509feb231083b7993..ec6b0777349410dd14e2b0219f9e4c920af52feb 100644 (file)
@@ -120,8 +120,14 @@ struct util_format_channel_description
 struct util_format_description
 {
    enum pipe_format format;
+
    const char *name;
 
+   /**
+    * Short name, striped of the prefix, lower case.
+    */
+   const char *short_name;
+
    /**
     * Pixel block dimensions.
     */
index 4e29d15f3bb2e7d6ca24ff0bcb0aa41c15bda340..f9d21ed8aa155b5b4a1bda0e6ca2671eec03b511 100755 (executable)
@@ -90,6 +90,7 @@ def write_format_table(formats):
     print 'util_format_none_description = {'
     print "   PIPE_FORMAT_NONE,"
     print "   \"PIPE_FORMAT_NONE\","
+    print "   \"none\","
     print "   {0, 0, 0},"
     print "   0,"
     print "   0,"
@@ -105,6 +106,7 @@ def write_format_table(formats):
         print 'util_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(),)