4
4
/**************************************************************************
6
* Copyright 2009 VMware, Inc.
6
* Copyright 2010 VMware, Inc.
7
7
* All Rights Reserved.
9
9
* Permission is hereby granted, free of charge, to any person obtaining a
85
86
print __doc__.strip()
87
88
print '#include "u_format.h"'
89
print 'const struct util_format_description'
90
print 'util_format_none_description = {'
91
print " PIPE_FORMAT_NONE,"
92
print " \"PIPE_FORMAT_NONE\","
98
print " {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},"
99
print " {0, 0, 0, 0},"
89
print '#include "u_format_s3tc.h"'
92
u_format_pack.generate(formats)
103
94
for format in formats:
104
95
print 'const struct util_format_description'
105
96
print 'util_format_%s_description = {' % (format.short_name(),)
106
97
print " %s," % (format.name,)
107
98
print " \"%s\"," % (format.name,)
99
print " \"%s\"," % (format.short_name(),)
108
100
print " {%u, %u, %u},\t/* block */" % (format.block_width, format.block_height, format.block_size())
109
101
print " %s," % (layout_map(format.layout),)
110
102
print " %u,\t/* nr_channels */" % (format.nr_channels(),)
111
103
print " %s,\t/* is_array */" % (bool_map(format.is_array()),)
104
print " %s,\t/* is_bitmask */" % (bool_map(format.is_bitmask()),)
112
105
print " %s,\t/* is_mixed */" % (bool_map(format.is_mixed()),)
114
107
for i in range(4):
136
129
print " %s%s\t/* %s */" % (swizzle_map[swizzle], sep, comment)
138
131
print " %s," % (colorspace_map(format.colorspace),)
132
if format.colorspace != ZS:
133
print " &util_format_%s_unpack_rgba_8unorm," % format.short_name()
134
print " &util_format_%s_pack_rgba_8unorm," % format.short_name()
135
if format.layout == 's3tc':
136
print " &util_format_%s_fetch_rgba_8unorm," % format.short_name()
138
print " NULL, /* fetch_rgba_8unorm */"
139
print " &util_format_%s_unpack_rgba_float," % format.short_name()
140
print " &util_format_%s_pack_rgba_float," % format.short_name()
141
print " &util_format_%s_fetch_rgba_float," % format.short_name()
143
print " NULL, /* unpack_rgba_8unorm */"
144
print " NULL, /* pack_rgba_8unorm */"
145
print " NULL, /* fetch_rgba_8unorm */"
146
print " NULL, /* unpack_rgba_float */"
147
print " NULL, /* pack_rgba_float */"
148
print " NULL, /* fetch_rgba_float */"
149
if format.colorspace == ZS and format.swizzles[0] != SWIZZLE_NONE:
150
print " &util_format_%s_unpack_z_32unorm," % format.short_name()
151
print " &util_format_%s_pack_z_32unorm," % format.short_name()
152
print " &util_format_%s_unpack_z_float," % format.short_name()
153
print " &util_format_%s_pack_z_float," % format.short_name()
155
print " NULL, /* unpack_z_32unorm */"
156
print " NULL, /* pack_z_32unorm */"
157
print " NULL, /* unpack_z_float */"
158
print " NULL, /* pack_z_float */"
159
if format.colorspace == ZS and format.swizzles[1] != SWIZZLE_NONE:
160
print " &util_format_%s_unpack_s_8uscaled," % format.short_name()
161
print " &util_format_%s_pack_s_8uscaled" % format.short_name()
163
print " NULL, /* unpack_s_8uscaled */"
164
print " NULL /* pack_s_8uscaled */"
141
168
print "const struct util_format_description *"
142
169
print "util_format_description(enum pipe_format format)"