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

2018-03-06 Thread Marek Olšák
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  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 
> Cc: Jordan Justen 
> Cc: Ian Romanick 
> Cc: Eric Engestrom 
> Cc: Emil Velikov 
> Signed-off-by: Andres Gomez 
> ---
>  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.
>   The format should be MAJOR.MINOR[FC]
>   FC is an optional suffix that indicates a forward compatible context.
>  This is only valid for versions >= 3.0.
> - GL versions < 3.0 are set to a compatibility (non-Core) profile
> - GL versions = 3.0, see below
> - GL versions > 3.0 are set to a Core profile
> - Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC
> + GL versions <= 3.1 are set to a compatibility (non-Core) profile
> + GL versions > 3.1 are set to a Core profile
> + Examples: 2.1, 3.0, 3.1, 3.1FC, 3.2, 3.2FC
>  
>   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
>  
>   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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2018-03-02 Thread Andres Gomez
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 
Cc: Jordan Justen 
Cc: Ian Romanick 
Cc: Eric Engestrom 
Cc: Emil Velikov 
Signed-off-by: Andres Gomez 
---
 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.
  The format should be MAJOR.MINOR[FC]
  FC is an optional suffix that indicates a forward compatible context.
 This is only valid for versions >= 3.0.
- GL versions < 3.0 are set to a compatibility (non-Core) profile
- GL versions = 3.0, see below
- GL versions > 3.0 are set to a Core profile
- Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC
+ GL versions <= 3.1 are set to a compatibility (non-Core) profile
+ GL versions > 3.1 are set to a Core profile
+ Examples: 2.1, 3.0, 3.1, 3.1FC, 3.2, 3.2FC
 
  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
 
  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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev