Jordan Justen <[email protected]> writes: > Change the format to MAJOR.MINOR[FC] > For example: 2.1, 3.0FC, 3.1 > > The FC suffix indicates a forward compatible context, and > is only valid for versions >= 3.0. > > Examples: > 2.1: GL Legacy/Compatibility context > 3.0: GL Legacy/Compatibility context > 3.0FC: GL Core Profile context + Forward Compatible > 3.1: GL Core Profile context > 3.1FC: GL Core Profile context + Forward Compatible
> +void
> +_mesa_override_gl_version(struct gl_context *ctx)
> +{
> + const char *env_var = "MESA_GL_VERSION_OVERRIDE";
> + const char *version;
> + char *version_dup;
> + int n;
> + int major, minor;
> + GLboolean fc_suffix;
> +
> + version = getenv(env_var);
> + if (!version) {
> + return;
> + }
> +
> + version_dup = strdup(version);
> + assert (version_dup != NULL);
> +
> + fc_suffix = check_for_ending_and_remove(version_dup, "FC");
Given that you don't do anything else with version_dup, why create it
and modify it? Just use version without truncating it.
> + if (ctx->Version >= 30 && fc_suffix) {
> + ctx->API = API_OPENGL_CORE;
> + ctx->Const.ContextFlags |=
> GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT;
> + } else if (ctx->Version >= 31) {
> + ctx->API = API_OPENGL_CORE;
> + } else {
> + ctx->API = API_OPENGL;
You're not setting the forward bit for >= 3.1 and FC like the
docs/commit msg say. With these two bits fixed, this series is:
Reviewed-by: Eric Anholt <[email protected]>
pgpornJ8XoIRX.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
