diff options
author | Nanley Chery <[email protected]> | 2015-09-17 15:49:40 -0700 |
---|---|---|
committer | Nanley Chery <[email protected]> | 2015-11-12 13:10:37 -0800 |
commit | ab129a44ae3a7515eb4642c068299673c890fb73 (patch) | |
tree | ba34b3a8f8d9042eb1957d497f67bab021afa044 /src/mesa/main/extensions.c | |
parent | eda15abd84af575d3bde432e2163e30d743a7c87 (diff) |
mesa: Generate a helper function for each extension
Generate functions which determine if an extension is supported in the
current context. Initially, enums were going to be explicitly used with
_mesa_extension_supported(). The idea to embed the function and enums
into generated helper functions was suggested by Kristian Høgsberg.
For performance, the function body no longer uses
_mesa_extension_supported() and, as suggested by Chad Versace, the
functions are also declared static inline.
v2: Place function qualifiers on separate line (Chad)
v3: Move function curly brace to new line (Chad)
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 | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index c7609bea0f0..7ef79e58963 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -42,27 +42,6 @@ struct gl_extensions _mesa_extension_override_disables; static char *extra_extensions = NULL; static char *cant_disable_extensions = NULL; -/** - * \brief An element of the \c extension_table. - */ -struct extension { - /** Name of extension, such as "GL_ARB_depth_clamp". */ - const char *name; - - /** Offset (in bytes) of the corresponding member in struct gl_extensions. */ - size_t offset; - - /** 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 - */ - uint8_t version[API_OPENGL_LAST + 1]; - - /** Year the extension was proposed or approved. Used to sort the - * extension string chronologically. */ - uint16_t year; -}; - /** * Given a member \c x of struct gl_extensions, return offset of @@ -74,7 +53,7 @@ struct extension { /** * \brief Table of supported OpenGL extensions for all API's. */ -static const struct extension extension_table[] = { +const struct extension extension_table[] = { #define EXT(name_str, driver_cap, gll_ver, glc_ver, gles_ver, gles2_ver, yyyy) \ { .name = "GL_" #name_str, .offset = o(driver_cap), \ .version = { \ |