enum util_format_layout {
- UTIL_FORMAT_LAYOUT_PLAIN = 0, /*< RGB, depth-stencil */
- UTIL_FORMAT_LAYOUT_DXT = 1
+ UTIL_FORMAT_LAYOUT_SCALAR = 0,
+ UTIL_FORMAT_LAYOUT_ARITH = 1,
+ UTIL_FORMAT_LAYOUT_ARRAY = 2,
+ UTIL_FORMAT_LAYOUT_YUV = 3,
+ UTIL_FORMAT_LAYOUT_DXT = 4
};
from u_format_parse import *
-layout_map = {
- 'arith': 'UTIL_FORMAT_LAYOUT_PLAIN',
- 'array': 'UTIL_FORMAT_LAYOUT_PLAIN',
- 'yuv': 'UTIL_FORMAT_LAYOUT_PLAIN',
- 'dxt': 'UTIL_FORMAT_LAYOUT_DXT',
-}
+def layout_map(layout):
+ return 'UTIL_FORMAT_LAYOUT_' + str(layout).upper()
def colorspace_map(colorspace):
print " %s," % (format.name,)
print " \"%s\"," % (format.name,)
print " {%u, %u, %u}, /* block */" % (format.block_width, format.block_height, format.block_size())
- print " %s," % (layout_map[format.layout],)
+ print " %s," % (layout_map(format.layout),)
print " {"
for i in range(4):
type = format.in_types[i]
format_desc->block.height != 1)
return FALSE;
- if(format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN)
+ if(format_desc->layout != UTIL_FORMAT_LAYOUT_SCALAR &&
+ format_desc->layout != UTIL_FORMAT_LAYOUT_ARITH &&
+ format_desc->layout != UTIL_FORMAT_LAYOUT_ARRAY)
return FALSE;
if(format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB &&
format_desc->block.height != 1)
return FALSE;
- if(format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN)
+ if(format_desc->layout != UTIL_FORMAT_LAYOUT_SCALAR &&
+ format_desc->layout != UTIL_FORMAT_LAYOUT_ARITH &&
+ format_desc->layout != UTIL_FORMAT_LAYOUT_ARRAY)
return FALSE;
if(format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB &&
desc = util_format_description(format);
- if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) {
+ if (desc->layout != UTIL_FORMAT_LAYOUT_ARITH &&
+ desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) {
debug_printf("r300: Bad format %s in %s:%d\n", pf_name(format),
__FUNCTION__, __LINE__);
assert(0);
assert(format);
- if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) {
+ if (desc->layout != UTIL_FORMAT_LAYOUT_ARITH &&
+ desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) {
debug_printf("r300: Bad format %s in %s:%d\n",
pf_name(format), __FUNCTION__, __LINE__);
return 0;
desc = util_format_description(format);
assert(desc);
- if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN) {
+ if (desc->layout == UTIL_FORMAT_LAYOUT_ARITH ||
+ desc->layout == UTIL_FORMAT_LAYOUT_ARRAY) {
#if 0
printf("%s\n", pf_name( format ) );
#endif
pinfo->mesa_format = st_pipe_format_to_mesa_format(format);
}
- else if (desc->colorspace == UTIL_FORMAT_COLORSPACE_YUV) {
+ else if (desc->layout == UTIL_FORMAT_LAYOUT_YUV) {
pinfo->mesa_format = MESA_FORMAT_YCBCR;
pinfo->datatype = GL_UNSIGNED_SHORT;
pinfo->size = 2; /* two bytes per "texel" */