diff options
author | Eric Anholt <[email protected]> | 2015-11-25 17:00:00 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-12-01 10:24:36 -0800 |
commit | 710762b64a16d41bb3223ff78b719be27a51b303 (patch) | |
tree | e69862cb00c2077b6be26a959893b748c62aba90 /src/mapi/glapi | |
parent | cbabf5f9dc4f69ef17e24566cb3fbc1c4ef0de4f (diff) |
mesa: Drop bitfield "enums" from the enum-to-string table.
Asking the table for bitfield names doesn't make any sense. For 0x10, do
you want GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV or
GL_COLOR_BUFFER_BIT4_QCOM or GL_POLYGON_STIPPLE_BIT or
GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV? Giving a useful answer would
depend on a whole lot of context.
This also fixes a bad enum table entry, where we chose GL_HINT_BIT instead
of GL_ABGR_EXT for 0x8000, so we can now fix its entry in the enum_strings
test.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mapi/glapi')
-rw-r--r-- | src/mapi/glapi/gen/gl_enums.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py index c8199e29f5c..5f4ad0b2af5 100644 --- a/src/mapi/glapi/gen/gl_enums.py +++ b/src/mapi/glapi/gen/gl_enums.py @@ -272,8 +272,17 @@ _mesa_lookup_prim_by_nr(GLuint nr) if value > 0xffffffff: return - if name.endswith('_BIT'): - priority += 100 + # We don't want bitfields in the enum-to-string table -- + # individual bits have so many names, it's pointless. Note + # that we check for power-of-two, since some getters have + # "_BITS" in their name, but none have a power-of-two enum + # number. + if not (value & (value - 1)) and '_BIT' in name: + return + + # Also drop the GL_*_ATTRIB_BITS bitmasks. + if value == 0xffffffff: + return if value in self.enum_table: (n, p) = self.enum_table[value] @@ -489,12 +498,6 @@ _mesa_lookup_prim_by_nr(GLuint nr) name = enum.get('name') value = int(enum.get('value'), base=16) - if name == 'GL_ALL_ATTRIB_BITS': - # Khronos XML defines this one as 0xffffffff, but Mesa - # has always had the original definition of - # 0x000fffff. - value = 0x000fffff - # If the same name ever maps to multiple values, that can # confuse us. GL_ACTIVE_PROGRAM_EXT is OK to lose because # we choose GL_ACTIVE PROGRAM instead. |