~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to src/gallium/auxiliary/util/u_format_table.py

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
'''
4
4
/**************************************************************************
5
5
 *
6
 
 * Copyright 2009 VMware, Inc.
 
6
 * Copyright 2010 VMware, Inc.
7
7
 * All Rights Reserved.
8
8
 *
9
9
 * Permission is hereby granted, free of charge, to any person obtaining a
33
33
import sys
34
34
 
35
35
from u_format_parse import *
 
36
import u_format_pack
36
37
 
37
38
 
38
39
def layout_map(layout):
85
86
    print __doc__.strip()
86
87
    print
87
88
    print '#include "u_format.h"'
88
 
    print
89
 
    print 'const struct util_format_description'
90
 
    print 'util_format_none_description = {'
91
 
    print "   PIPE_FORMAT_NONE,"
92
 
    print "   \"PIPE_FORMAT_NONE\","
93
 
    print "   {0, 0, 0},"
94
 
    print "   0,"
95
 
    print "   0,"
96
 
    print "   0,"
97
 
    print "   0,"
98
 
    print "   {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},"
99
 
    print "   {0, 0, 0, 0},"
100
 
    print "   0"
101
 
    print "};"
102
 
    print
 
89
    print '#include "u_format_s3tc.h"'
 
90
    print
 
91
    
 
92
    u_format_pack.generate(formats)
 
93
    
103
94
    for format in formats:
104
95
        print 'const struct util_format_description'
105
96
        print 'util_format_%s_description = {' % (format.short_name(),)
106
97
        print "   %s," % (format.name,)
107
98
        print "   \"%s\"," % (format.name,)
 
99
        print "   \"%s\"," % (format.short_name(),)
108
100
        print "   {%u, %u, %u},\t/* block */" % (format.block_width, format.block_height, format.block_size())
109
101
        print "   %s," % (layout_map(format.layout),)
110
102
        print "   %u,\t/* nr_channels */" % (format.nr_channels(),)
111
103
        print "   %s,\t/* is_array */" % (bool_map(format.is_array()),)
 
104
        print "   %s,\t/* is_bitmask */" % (bool_map(format.is_bitmask()),)
112
105
        print "   %s,\t/* is_mixed */" % (bool_map(format.is_mixed()),)
113
106
        print "   {"
114
107
        for i in range(4):
136
129
            print "      %s%s\t/* %s */" % (swizzle_map[swizzle], sep, comment)
137
130
        print "   },"
138
131
        print "   %s," % (colorspace_map(format.colorspace),)
 
132
        if format.colorspace != ZS:
 
133
            print "   &util_format_%s_unpack_rgba_8unorm," % format.short_name() 
 
134
            print "   &util_format_%s_pack_rgba_8unorm," % format.short_name() 
 
135
            if format.layout == 's3tc':
 
136
                print "   &util_format_%s_fetch_rgba_8unorm," % format.short_name()
 
137
            else:
 
138
                print "   NULL, /* fetch_rgba_8unorm */" 
 
139
            print "   &util_format_%s_unpack_rgba_float," % format.short_name() 
 
140
            print "   &util_format_%s_pack_rgba_float," % format.short_name() 
 
141
            print "   &util_format_%s_fetch_rgba_float," % format.short_name()
 
142
        else:
 
143
            print "   NULL, /* unpack_rgba_8unorm */" 
 
144
            print "   NULL, /* pack_rgba_8unorm */" 
 
145
            print "   NULL, /* fetch_rgba_8unorm */" 
 
146
            print "   NULL, /* unpack_rgba_float */" 
 
147
            print "   NULL, /* pack_rgba_float */" 
 
148
            print "   NULL, /* fetch_rgba_float */" 
 
149
        if format.colorspace == ZS and format.swizzles[0] != SWIZZLE_NONE:
 
150
            print "   &util_format_%s_unpack_z_32unorm," % format.short_name() 
 
151
            print "   &util_format_%s_pack_z_32unorm," % format.short_name() 
 
152
            print "   &util_format_%s_unpack_z_float," % format.short_name() 
 
153
            print "   &util_format_%s_pack_z_float," % format.short_name() 
 
154
        else:
 
155
            print "   NULL, /* unpack_z_32unorm */" 
 
156
            print "   NULL, /* pack_z_32unorm */" 
 
157
            print "   NULL, /* unpack_z_float */" 
 
158
            print "   NULL, /* pack_z_float */" 
 
159
        if format.colorspace == ZS and format.swizzles[1] != SWIZZLE_NONE:
 
160
            print "   &util_format_%s_unpack_s_8uscaled," % format.short_name() 
 
161
            print "   &util_format_%s_pack_s_8uscaled" % format.short_name() 
 
162
        else:
 
163
            print "   NULL, /* unpack_s_8uscaled */" 
 
164
            print "   NULL /* pack_s_8uscaled */" 
139
165
        print "};"
140
166
        print
 
167
        
141
168
    print "const struct util_format_description *"
142
169
    print "util_format_description(enum pipe_format format)"
143
170
    print "{"
146
173
    print "   }"
147
174
    print
148
175
    print "   switch (format) {"
149
 
    print "   case PIPE_FORMAT_NONE:"
150
 
    print "      return &util_format_none_description;"
151
176
    for format in formats:
152
177
        print "   case %s:" % format.name
153
178
        print "      return &util_format_%s_description;" % (format.short_name(),)
154
179
    print "   default:"
155
 
    print "      assert(0);"
156
180
    print "      return NULL;"
157
181
    print "   }"
158
182
    print "}"