[Mesa-dev] [PATCH 1/3] mesa: override to GL core API only when >= 3.2

Marek Olšák maraeo at gmail.com
Tue Mar 6 22:13:22 UTC 2018


HI Andres,

Thanks for pointing this out. Instead of yours, I'll send my own patch
that removes the version check completely.

Marek

On Fri, Mar 2, 2018 at 8:02 AM, Andres Gomez <agomez at igalia.com> wrote:
> a0c8b49284e enabled the OpenGL 3.1 compat profile. Hence, when setting
> MESA_GL_VERSION_OVERRIDE=3.1 we want to keep the compat profile, as it
> already happens with <= 3.0.
>
> Additionally, update and add some extra comments on the overriding
> function.
>
> Fixes: a0c8b49284e ("mesa: enable OpenGL 3.1 with ARB_compatibility")
>
> Cc: Marek Olšák <marek.olsak at amd.com>
> Cc: Jordan Justen <jordan.l.justen at intel.com>
> Cc: Ian Romanick <ian.d.romanick at intel.com>
> Cc: Eric Engestrom <eric.engestrom at imgtec.com>
> Cc: Emil Velikov <emil.velikov at collabora.com>
> Signed-off-by: Andres Gomez <agomez at igalia.com>
> ---
>  docs/envvars.html       | 12 ++++++------
>  src/mesa/main/version.c |  7 ++++---
>  2 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/docs/envvars.html b/docs/envvars.html
> index ea42a50779b..4ea5670b78d 100644
> --- a/docs/envvars.html
> +++ b/docs/envvars.html
> @@ -91,16 +91,16 @@ glGetString(GL_VERSION) and possibly the GL API type.
>  <li> The format should be MAJOR.MINOR[FC]
>  <li> FC is an optional suffix that indicates a forward compatible context.
>  This is only valid for versions >= 3.0.
> -<li> GL versions < 3.0 are set to a compatibility (non-Core) profile
> -<li> GL versions = 3.0, see below
> -<li> GL versions > 3.0 are set to a Core profile
> -<li> Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC
> +<li> GL versions <= 3.1 are set to a compatibility (non-Core) profile
> +<li> GL versions > 3.1 are set to a Core profile
> +<li> Examples: 2.1, 3.0, 3.1, 3.1FC, 3.2, 3.2FC
>  <ul>
>  <li> 2.1 - select a compatibility (non-Core) profile with GL version 2.1
>  <li> 3.0 - select a compatibility (non-Core) profile with GL version 3.0
> -<li> 3.0FC - select a Core+Forward Compatible profile with GL version 3.0
> -<li> 3.1 - select a Core profile with GL version 3.1
> +<li> 3.1 - select a compatibility (non-Core) profile with GL version 3.1
>  <li> 3.1FC - select a Core+Forward Compatible profile with GL version 3.1
> +<li> 3.2 - select a Core profile with GL version 3.2
> +<li> 3.2FC - select a Core+Forward Compatible profile with GL version 3.2
>  </ul>
>  <li> Mesa may not really implement all the features of the given version.
>  (for developers only)
> diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
> index a28069054d3..5184ebd8fdb 100644
> --- a/src/mesa/main/version.c
> +++ b/src/mesa/main/version.c
> @@ -141,9 +141,10 @@ create_version_string(struct gl_context *ctx, const char *prefix)
>   *
>   * 2.1: select a compatibility (non-Core) profile with GL version 2.1
>   * 3.0: select a compatibility (non-Core) profile with GL version 3.0
> - * 3.0FC: select a Core+Forward Compatible profile with GL version 3.0
> - * 3.1: select a Core profile with GL version 3.1
> + * 3.1: select a compatibility (non-Core) profile with GL version 3.1
>   * 3.1FC: select a Core+Forward Compatible profile with GL version 3.1
> + * 3.2: select a Core profile with GL version 3.2
> + * 3.2FC: select a Core+Forward Compatible profile with GL version 3.2
>   */
>  bool
>  _mesa_override_gl_version_contextless(struct gl_constants *consts,
> @@ -165,7 +166,7 @@ _mesa_override_gl_version_contextless(struct gl_constants *consts,
>           if (version >= 30 && fwd_context) {
>              *apiOut = API_OPENGL_CORE;
>              consts->ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT;
> -         } else if (version >= 31 && !compat_context) {
> +         } else if (version >= 32 && !compat_context) {
>              *apiOut = API_OPENGL_CORE;
>           } else {
>              *apiOut = API_OPENGL_COMPAT;
> --
> 2.15.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list