From a16ffb743ced9fde80b2485dfc2d86ae74e86f25 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Thu, 15 Oct 2015 12:34:43 -0700 Subject: mesa: In helpers, only check driver capability for meta Make API context and version checks done by the helper functions pass unconditionally while meta is in progress. This transparently makes extension checks solely dependent on struct gl_extensions while in meta. v2: Use an 8-bit data type instead of a GLuint Signed-off-by: Nanley Chery Reviewed-by: Chad Versace --- src/mesa/main/extensions.h | 2 +- src/mesa/main/mtypes.h | 6 ++++++ src/mesa/main/version.c | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index 4ea2af13efc..e4671be2cf6 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -91,7 +91,7 @@ enum { static inline bool \ _mesa_has_##name_str(const struct gl_context *ctx) \ { \ - return ctx->Extensions.driver_cap && (ctx->Version >= \ + return ctx->Extensions.driver_cap && (ctx->Extensions.Version >= \ _mesa_extension_table[MESA_EXTENSION_##name_str].version[ctx->API]); \ } #include "extensions_table.h" diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 8de9c773b9f..c4d8c6a8cb4 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3820,6 +3820,12 @@ struct gl_extensions const GLubyte *String; /** Number of supported extensions */ GLuint Count; + /** + * The context version which extension helper functions compare against. + * By default, the value is equal to ctx->Version. This changes to ~0 + * while meta is in progress. + */ + GLubyte Version; }; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 5635a643200..314b26dc74f 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -524,6 +524,7 @@ _mesa_compute_version(struct gl_context *ctx) return; ctx->Version = _mesa_get_version(&ctx->Extensions, &ctx->Const, ctx->API); + ctx->Extensions.Version = ctx->Version; /* Make sure that the GLSL version lines up with the GL version. In some * cases it can be too high, e.g. if an extension is missing. -- cgit v1.2.3