summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/extensions.c
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2015-09-08 12:25:56 -0700
committerNanley Chery <[email protected]>2015-11-12 13:10:37 -0800
commitf47df8f729abfda177120a1437197372fd19b83f (patch)
tree470ea40932aee71e524b0bfd3bb9a7dbdbf415ab /src/mesa/main/extensions.c
parent8bd82a91c05804260041b572b1a5d812cb58ae96 (diff)
mesa/extensions: Add extension::version
Enable limiting advertised extension support by context version with finer granularity. This new field is currently unused and is set to 0 everywhere. When it is used, a value of 0 will indicate that the extension is supported for any version of a context. v2: Use uint*t type for version and note the expected values (Emil) Use an 8-bit data type Reformat macro for better readability (Chad) v3: Note preparatory nature of commit (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.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 30f5b9868d3..4fd7487e7e2 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -66,6 +66,12 @@ struct extension {
/** 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
+ */
+ uint8_t version[API_OPENGL_LAST + 1];
+
/** Year the extension was proposed or approved. Used to sort the
* extension string chronologically. */
uint16_t year;
@@ -83,8 +89,16 @@ 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, yyyy) \
- { .name = "GL_" #name_str, .offset = o(driver_cap), .api_set = api_flags, .year = yyyy},
+#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, \
+ .version = { \
+ [API_OPENGL_COMPAT] = gll_ver, \
+ [API_OPENGL_CORE] = glc_ver, \
+ [API_OPENGLES] = gles_ver, \
+ [API_OPENGLES2] = gles2_ver, \
+ }, \
+ .year = yyyy \
+ },
#include "extensions_table.h"
#undef EXT
};