mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 00:10:20 +01:00
util: Fix generated swizzle comments.
This commit is contained in:
parent
cdb6849fc1
commit
7fc75ef7d4
1 changed files with 9 additions and 10 deletions
|
|
@ -44,11 +44,10 @@ def colorspace_map(colorspace):
|
|||
|
||||
|
||||
colorspace_channels_map = {
|
||||
'rgb': 'rgba',
|
||||
'rgba': 'rgba',
|
||||
'zs': 'zs',
|
||||
'yuv': ['y1', 'y2', 'u', 'v'],
|
||||
'dxt': []
|
||||
'rgb': ['r', 'g', 'b', 'a'],
|
||||
'srgb': ['sr', 'sg', 'sb', 'a'],
|
||||
'zs': ['z', 's'],
|
||||
'yuv': ['y', 'u', 'v'],
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -94,7 +93,7 @@ def write_format_table(formats):
|
|||
print " {"
|
||||
print " %s," % (format.name,)
|
||||
print " \"%s\"," % (format.name,)
|
||||
print " {%u, %u, %u}, /* block */" % (format.block_width, format.block_height, format.block_size())
|
||||
print " {%u, %u, %u},\t/* block */" % (format.block_width, format.block_height, format.block_size())
|
||||
print " %s," % (layout_map(format.layout),)
|
||||
print " {"
|
||||
for i in range(4):
|
||||
|
|
@ -103,7 +102,7 @@ def write_format_table(formats):
|
|||
sep = ","
|
||||
else:
|
||||
sep = ""
|
||||
print " {%s, %s, %u}%s /* %s */" % (kind_map[type.kind], bool_map(type.norm), type.size, sep, "xyzw"[i])
|
||||
print " {%s, %s, %u}%s\t/* %s */" % (kind_map[type.kind], bool_map(type.norm), type.size, sep, "xyzw"[i])
|
||||
print " },"
|
||||
print " {"
|
||||
for i in range(4):
|
||||
|
|
@ -113,10 +112,10 @@ def write_format_table(formats):
|
|||
else:
|
||||
sep = ""
|
||||
try:
|
||||
comment = layout_channels_map[format.layout][i]
|
||||
except:
|
||||
comment = colorspace_channels_map[format.colorspace][i]
|
||||
except (KeyError, IndexError):
|
||||
comment = 'ignored'
|
||||
print " %s%s /* %s */" % (swizzle_map[swizzle], sep, comment)
|
||||
print " %s%s\t/* %s */" % (swizzle_map[swizzle], sep, comment)
|
||||
print " },"
|
||||
print " %s," % (colorspace_map(format.colorspace),)
|
||||
print " },"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue