diff options
author | Nanley Chery <[email protected]> | 2015-09-21 11:23:33 -0700 |
---|---|---|
committer | Nanley Chery <[email protected]> | 2015-11-12 13:10:37 -0800 |
commit | eda15abd84af575d3bde432e2163e30d743a7c87 (patch) | |
tree | a81b65c3c35dcf87fb4f9566b795f536d3f4309b /src/mesa/main/extensions.c | |
parent | a82bc779af37334ebc874d38951324f5f0b651cd (diff) |
mesa/extensions: Replace extension::api_set with ::version
The api_set field has no users outside of _mesa_extension_supported().
Remove it and allow the version field to take its place.
The brunt of the transformation was performed with the following vim commands:
s/\(GL [^,]\+\),\s*\d*,\s*\d*\(,\s*\d*\)\(,\s*\d*\)/\1, GLL, GLC\2\3/g
s/\(GLL [^,]\+\)\,\s*\d*/\1, GLL/g
s/\(GLC [^,]\+\)\(,\s*\d*\),\s*\d*\(,\s*\d*\)\(,\s*\d*\)/\1\2, GLC\3\4/g
s/\( ES1[^,]*\)\(,\s*\(\w\|\d\)\+\)\(,\s*\(\w\|\d\)\+\),\s*\d*/\1\2\4, ES1/g
s/\( ES2[^,]*\)\(,\s*\(\w\|\d\)\+\)\(,\s*\(\w\|\d\)\+\)\(,\s*\(\w\|\d\)\+\),\s*\d*/\1\2\4\6, ES2/g
Signed-off-by: Nanley Chery <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/main/extensions.c')
-rw-r--r-- | src/mesa/main/extensions.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 1ce73f3bab0..c7609bea0f0 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -42,15 +42,6 @@ struct gl_extensions _mesa_extension_override_disables; static char *extra_extensions = NULL; static char *cant_disable_extensions = NULL; -enum { - DISABLE = 0, - GLL = 1 << API_OPENGL_COMPAT, /* GL Legacy / Compatibility */ - GLC = 1 << API_OPENGL_CORE, /* GL Core */ - GL = (1 << API_OPENGL_COMPAT) | (1 << API_OPENGL_CORE), - ES1 = 1 << API_OPENGLES, - ES2 = 1 << API_OPENGLES2, -}; - /** * \brief An element of the \c extension_table. */ @@ -61,9 +52,6 @@ struct extension { /** Offset (in bytes) of the corresponding member in struct gl_extensions. */ size_t offset; - /** Set of API's in which the extension exists, as a bitset. */ - uint8_t api_set; - /** Minimum version the extension requires for the given API * (see gl_api defined in mtypes.h). The value is equal to: * 10 * major_version + minor_version @@ -87,8 +75,8 @@ struct extension { * \brief Table of supported OpenGL extensions for all API's. */ static const struct extension extension_table[] = { -#define EXT(name_str, driver_cap, api_flags, gll_ver, glc_ver, gles_ver, gles2_ver, yyyy) \ - { .name = "GL_" #name_str, .offset = o(driver_cap), .api_set = api_flags, \ +#define EXT(name_str, driver_cap, gll_ver, glc_ver, gles_ver, gles2_ver, yyyy) \ + { .name = "GL_" #name_str, .offset = o(driver_cap), \ .version = { \ [API_OPENGL_COMPAT] = gll_ver, \ [API_OPENGL_CORE] = glc_ver, \ @@ -434,11 +422,8 @@ _mesa_extension_supported(const struct gl_context *ctx, extension_index i) { const bool *base = (bool *) &ctx->Extensions; const struct extension *ext = extension_table + i; - const uint8_t api_bit = 1 << ctx->API; - return (ext->api_set & api_bit) && - (ctx->Version >= ext->version[ctx->API]) && - base[ext->offset]; + return (ctx->Version >= ext->version[ctx->API]) && base[ext->offset]; } /** |