aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_format_table.py
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-07-28 08:47:13 +0100
committerJosé Fonseca <[email protected]>2009-08-29 09:21:20 +0100
commit42b15b26fd946c9511bd4bd5f23ec7e76e15507c (patch)
treea6d5c5613a8435bcfcf0ec7191db67adab53755d /src/gallium/auxiliary/util/u_format_table.py
parenta910c7d8202d42d2637aeeac3f3e9f2cd77ffc07 (diff)
util: Make pixel format layout more meaningful.
Namelly, explicitly distinguish formats coded by arithmetic manipulation, from formats layed out in array.
Diffstat (limited to 'src/gallium/auxiliary/util/u_format_table.py')
-rwxr-xr-xsrc/gallium/auxiliary/util/u_format_table.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py
index e94fbbecb37..c536e39171c 100755
--- a/src/gallium/auxiliary/util/u_format_table.py
+++ b/src/gallium/auxiliary/util/u_format_table.py
@@ -51,9 +51,6 @@ class Type:
return s
-SCALED, NORM, SRGB = 'scaled', 'norm', 'srgb'
-
-
class Format:
def __init__(self, name, layout, block_width, block_height, in_types, out_swizzle, colorspace):
@@ -111,7 +108,12 @@ def layout_map(layout):
return 'UTIL_FORMAT_LAYOUT_' + str(layout).upper()
-layout_channels_map = {
+def colorspace_map(colorspace):
+ return 'UTIL_FORMAT_COLORSPACE_' + str(colorspace).upper()
+
+
+colorspace_channels_map = {
+ 'rgb': 'rgba',
'rgba': 'rgba',
'zs': 'zs',
'yuv': ['y1', 'y2', 'u', 'v'],
@@ -186,7 +188,7 @@ def write_format_table(formats):
comment = 'ignored'
print " %s%s /* %s */" % (swizzle_map[swizzle], sep, comment)
print " },"
- print " UTIL_FORMAT_COLORSPACE_RGB,"
+ print " %s," % (colorspace_map(format.colorspace),)
print " },"
print " {"
print " PIPE_FORMAT_NONE,"