save->API = ctx->API;
ctx->API = API_OPENGL_COMPAT;
+ /* Mesa's extension helper functions use the current context's API to look up
+ * the version required by an extension as a step in determining whether or
+ * not it has been advertised. Since meta aims to only be restricted by the
+ * driver capability (and not by whether or not an extension has been
+ * advertised), set the helper functions' Version variable to a value that
+ * will make the checks on the context API and version unconditionally pass.
+ */
+ save->ExtensionsVersion = ctx->Extensions.Version;
+ ctx->Extensions.Version = ~0;
+
/* Pausing transform feedback needs to be done early, or else we won't be
* able to change other state.
*/
ctx->Meta->SaveStackDepth--;
ctx->API = save->API;
+ ctx->Extensions.Version = save->ExtensionsVersion;
}
/* Always saved/restored with meta. */
gl_api API;
+ uint8_t ExtensionsVersion;
/** MESA_META_CLEAR (and others?) */
struct gl_query_object *CurrentOcclusionObject;
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"
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;
};
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.