-#!/usr/bin/env python
CopyRight = '''
/**************************************************************************
swizzle_map = {
- SWIZZLE_X: "UTIL_FORMAT_SWIZZLE_X",
- SWIZZLE_Y: "UTIL_FORMAT_SWIZZLE_Y",
- SWIZZLE_Z: "UTIL_FORMAT_SWIZZLE_Z",
- SWIZZLE_W: "UTIL_FORMAT_SWIZZLE_W",
- SWIZZLE_0: "UTIL_FORMAT_SWIZZLE_0",
- SWIZZLE_1: "UTIL_FORMAT_SWIZZLE_1",
- SWIZZLE_NONE: "UTIL_FORMAT_SWIZZLE_NONE",
+ SWIZZLE_X: "PIPE_SWIZZLE_X",
+ SWIZZLE_Y: "PIPE_SWIZZLE_Y",
+ SWIZZLE_Z: "PIPE_SWIZZLE_Z",
+ SWIZZLE_W: "PIPE_SWIZZLE_W",
+ SWIZZLE_0: "PIPE_SWIZZLE_0",
+ SWIZZLE_1: "PIPE_SWIZZLE_1",
+ SWIZZLE_NONE: "PIPE_SWIZZLE_NONE",
}
print '#include "u_format_rgtc.h"'
print '#include "u_format_latc.h"'
print '#include "u_format_etc.h"'
- print '#include "u_format_bptc.h"'
print
u_format_pack.generate(formats)
u_format_pack.print_channels(format, do_channel_array)
u_format_pack.print_channels(format, do_swizzle_array)
print " %s," % (colorspace_map(format.colorspace),)
- if format.colorspace != ZS and not format.is_pure_color():
+ access = True
+ if format.layout in ('bptc', 'astc'):
+ access = False
+ if format.layout == 'etc' and format.short_name() != 'etc1_rgb8':
+ access = False
+ if format.colorspace != ZS and not format.is_pure_color() and access:
print " &util_format_%s_unpack_rgba_8unorm," % format.short_name()
print " &util_format_%s_pack_rgba_8unorm," % format.short_name()
- if format.layout == 's3tc' or format.layout == 'rgtc' or format.layout == 'bptc':
+ if format.layout == 's3tc' or format.layout == 'rgtc':
print " &util_format_%s_fetch_rgba_8unorm," % format.short_name()
else:
print " NULL, /* fetch_rgba_8unorm */"