# internal formats to base in- ternal formats, and desired component
# resolutions for each sized internal format."
+# None
+# Described as regular uint_8 bytes, i.e. PIPE_FORMAT_R8_USCALED
+PIPE_FORMAT_NONE , plain, 1, 1, u8 , , , , x001, rgb
+
# Typical rendertarget formats
PIPE_FORMAT_B8G8R8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, rgb
PIPE_FORMAT_B8G8R8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , x8 , zyx1, rgb
{
const struct util_format_description *desc = util_format_description(format);
- assert(format);
- if (!format) {
+ assert(desc);
+ if (!desc) {
return "???";
}
{
const struct util_format_description *desc = util_format_description(format);
- assert(format);
- if (!format) {
+ assert(desc);
+ if (!desc) {
return FALSE;
}
{
const struct util_format_description *desc = util_format_description(format);
- assert(format);
- if (!format) {
+ assert(desc);
+ if (!desc) {
return FALSE;
}
{
const struct util_format_description *desc = util_format_description(format);
- assert(format);
- if (!format) {
+ assert(desc);
+ if (!desc) {
return FALSE;
}
{
const struct util_format_description *desc = util_format_description(format);
- assert(format);
- if (!format) {
+ assert(desc);
+ if (!desc) {
return 0;
}
{
const struct util_format_description *desc = util_format_description(format);
- assert(format);
- if (!format) {
+ assert(desc);
+ if (!desc) {
return 1;
}
{
const struct util_format_description *desc = util_format_description(format);
- assert(format);
- if (!format) {
+ assert(desc);
+ if (!desc) {
return 1;
}
'''
/**************************************************************************
*
- * Copyright 2009 VMware, Inc.
+ * Copyright 2010 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
print
print '#include "u_format.h"'
print
- print '''
-static void
-util_format_none_unpack_8unorm(uint8_t *dst, const uint8_t *src, unsigned length)
-{
-}
-
-static void
-util_format_none_pack_8unorm(uint8_t *dst, const uint8_t *src, unsigned length)
-{
-}
-
-static void
-util_format_none_unpack_float(float *dst, const uint8_t *src, unsigned length)
-{
-}
-
-static void
-util_format_none_pack_float(uint8_t *dst, const float *src, unsigned length)
-{
-}
-
-static void
-util_format_none_fetch_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
-{
-}
- '''
- print 'const struct util_format_description'
- print 'util_format_none_description = {'
- print " PIPE_FORMAT_NONE,"
- print " \"PIPE_FORMAT_NONE\","
- print " \"none\","
- print " {0, 0, 0},"
- print " 0,"
- print " 0,"
- print " 0,"
- print " 0,"
- print " 0,"
- print " {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},"
- print " {0, 0, 0, 0},"
- print " 0,"
- print " &util_format_none_unpack_8unorm,"
- print " &util_format_none_pack_8unorm,"
- print " &util_format_none_unpack_float,"
- print " &util_format_none_pack_float,"
- print " &util_format_none_fetch_float"
- print "};"
- print
u_format_pack.generate(formats)
print " }"
print
print " switch (format) {"
- print " case PIPE_FORMAT_NONE:"
- print " return &util_format_none_description;"
for format in formats:
print " case %s:" % format.name
print " return &util_format_%s_description;" % (format.short_name(),)