/** * Set the context's Version and VersionString fields. * This should only be called once as part of context initialization * or to perform version check for GLX_ARB_create_context_profile. */ void _mesa_compute_version(struct gl_context *ctx) { if (ctx->Version) return; switch (ctx->API) { case API_OPENGL_COMPAT: /* Disable GLSL 1.40 and later for legacy contexts. * This disallows creation of the GL 3.1 compatibility context. */ if (ctx->Const.GLSLVersion > 130) { ctx->Const.GLSLVersion = 130; } /* fall through */ case API_OPENGL_CORE: compute_version(ctx); break; case API_OPENGLES: compute_version_es1(ctx); break; case API_OPENGLES2: compute_version_es2(ctx); break; case API_VK: break; } }
/** * Set the context's VersionMajor, VersionMinor, VersionString fields. * This should only be called once as part of context initialization * or to perform version check for GLX_ARB_create_context_profile. */ void _mesa_compute_version(struct gl_context *ctx) { if (ctx->VersionMajor) return; switch (ctx->API) { case API_OPENGL: compute_version(ctx); break; case API_OPENGLES: compute_version_es1(ctx); break; case API_OPENGLES2: compute_version_es2(ctx); break; } }