On 03/02/2018 02:55 PM, Andres Gomez wrote:
> 2599b92eb97 changed Mesa's behavior to allow Compatiblity profile with
> 3.1, and fail when the driver doesn't implement it, if the Core
> profile is not requested by applications.
> 
> Formerly, when requesting a 3.1 Compatibility profile Mesa would
> always fall back into a Core profile. We go back to that behavior now
> so, if the specific driver is not supporting 3.1 with Compatibility
> profile, we will keep falling back into 3.1 Core.
> 
> Fixes: a0c8b49284e ("mesa: enable OpenGL 3.1 with ARB_compatibility")
> 
> Cc: Marek Olšák <marek.ol...@amd.com>
> Cc: Ian Romanick <ian.d.roman...@intel.com>
> Cc: Kenneth Graunke <kenn...@whitecape.org>
> Cc: Eric Engestrom <eric.engest...@imgtec.com>
> Cc: Emil Velikov <emil.veli...@collabora.com>
> Signed-off-by: Andres Gomez <ago...@igalia.com>
> ---
>  docs/features.txt                      |  4 ++--
>  src/mesa/drivers/dri/common/dri_util.c | 10 ++++++++++
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/docs/features.txt b/docs/features.txt
> index 5eae34bf0df..d53dd805b1d 100644
> --- a/docs/features.txt
> +++ b/docs/features.txt
> @@ -25,8 +25,8 @@ not started
>  # OpenGL Core and Compatibility context support
>  
>  Some drivers do not support the Compatibility profile or ARB_compatibility.
> -Such drivers are limited to OpenGL 3.0 if the Core profile is not requested
> -by applications. Some of the later GL features are exposed in the 3.0 context
> +Such drivers are limited to use OpenGL 3.1 and later in Core
> +profile. Some of the later GL features are exposed in the 3.0 context

As I said in review of another patch, we need to stop saying OpenGL 3.1
{core,compatibility} profile.  There is no such thing as a profile
before OpenGL 3.2.  Our use of that mechanism is merely an artifact of
how we have implemented things to support multiple drivers in multiple APIs.

I would suggest wording this as:

Some drivers do not support the Compatibility profile or the
ARB_compatibility extensions.  If an application does not request a
specific version without the forward-compatiblity flag, such drivers
will be limited to OpenGL 3.0.  If an application requests OpenGL 3.1,
it will get a context that may or may not have the ARB_compatibility
extension enabled.  Some of the later GL features are exposed in the 3.0
context as extensions.

>  as extensions.
>  
>  
> diff --git a/src/mesa/drivers/dri/common/dri_util.c 
> b/src/mesa/drivers/dri/common/dri_util.c
> index a34f38d6114..53461dfb4e0 100644
> --- a/src/mesa/drivers/dri/common/dri_util.c
> +++ b/src/mesa/drivers/dri/common/dri_util.c
> @@ -381,6 +381,16 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
>       }
>      }
>  
> +    /* The specific Mesa driver may not support the GL_ARB_compatibilty
> +     * extension or the compatibility profile.  In that case, we treat an
> +     * API_OPENGL_COMPAT 3.1 as API_OPENGL_CORE. We reject API_OPENGL_COMPAT
> +     * 3.2+ in any case.
> +     */
> +    if (mesa_api == API_OPENGL_COMPAT &&
> +        ctx_config.major_version == 3 && ctx_config.minor_version == 1 &&
> +        screen->max_gl_compat_version < 31)
> +       mesa_api = API_OPENGL_CORE;
> +
>      if (mesa_api == API_OPENGL_COMPAT
>          && ((ctx_config.major_version > 3)
>              || (ctx_config.major_version == 3 &&
> 

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to