diff options
Diffstat (limited to 'src/mesa/main/format_info.py')
-rw-r--r-- | src/mesa/main/format_info.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py index b8956a5ba1c..448bd005537 100644 --- a/src/mesa/main/format_info.py +++ b/src/mesa/main/format_info.py @@ -96,6 +96,14 @@ def get_gl_data_type(fmat): else: assert False +def get_mesa_layout(fmat): + if fmat.layout == 'array': + return 'MESA_FORMAT_LAYOUT_ARRAY' + elif fmat.layout == 'packed': + return 'MESA_FORMAT_LAYOUT_PACKED' + else: + return 'MESA_FORMAT_LAYOUT_OTHER' + def get_channel_bits(fmat, chan_name): if fmat.is_compressed(): # These values are pretty-much bogus, but OpenGL requires that we @@ -166,6 +174,7 @@ for fmat in formats: print ' {' print ' {0},'.format(fmat.name) print ' "{0}",'.format(fmat.name) + print ' {0},'.format(get_mesa_layout(fmat)) print ' {0},'.format(get_gl_base_format(fmat)) print ' {0},'.format(get_gl_data_type(fmat)) @@ -176,6 +185,8 @@ for fmat in formats: print ' {0}, {1}, {2},'.format(fmat.block_width, fmat.block_height, int(fmat.block_size() / 8)) + + print ' {{ {0} }},'.format(', '.join(map(str, fmat.swizzle))) print ' },' print '};' |