[Mesa-dev] [PATCH] mesa: Set ProfileMask properly for core profile.

Kenneth Graunke kenneth at whitecape.org
Mon Jul 8 22:30:16 PDT 2013


On 07/08/2013 04:09 PM, Matt Turner wrote:
> Fixes MESA_GL_VERSION_OVERRIDE=3.2 egl-create-context-verify-gl-flavor.
> ---
>   src/mesa/main/context.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index 5ad04cc..d687fb7 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -636,8 +636,10 @@ _mesa_init_constants(struct gl_context *ctx)
>      ctx->Const.MaxTransformFeedbackInterleavedComponents = 4 * MAX_FEEDBACK_ATTRIBS;
>      ctx->Const.MaxVertexStreams = 1;
>
> -   /* GL 3.2: hard-coded for now: */
> -   ctx->Const.ProfileMask = GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;
> +   /* GL 3.2  */
> +   ctx->Const.ProfileMask = ctx->API == API_OPENGL_CORE
> +                          ? GL_CONTEXT_CORE_PROFILE_BIT
> +                          : GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;
>
>      /** GL_EXT_gpu_shader4 */
>      ctx->Const.MinProgramTexelOffset = -8;

Ah, I see - this is only used for glGetIntegerv with 
GL_CONTEXT_PROFILE_MASK.  Seems reasonable then.

Unless someone is planning on implementing the compatibility profile 
(which I doubt), this could just be:

    ctx->Const.ProfileMask = GL_CONTEXT_CORE_PROFILE_BIT;

but I think the way you have it is a bit more obvious/self-documenting, 
so I'm fine with it.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list