[Mesa-dev] [PATCH 1/2] mesa: add switch case for GL 2.1 in _mesa_compute_version()

Ian Romanick idr at freedesktop.org
Wed Aug 1 18:45:30 UTC 2018


On 07/27/2018 12:07 PM, Brian Paul wrote:
> The xlib/swrast driver only supports GL 2.1.  This patch fixes a
> crash if the app calls glGetString(GL_SHADING_LANGUAGE_VERSION).
> ---
>  src/mesa/main/version.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
> index 58e68b4..2c5bd77 100644
> --- a/src/mesa/main/version.c
> +++ b/src/mesa/main/version.c
> @@ -617,6 +617,9 @@ _mesa_compute_version(struct gl_context *ctx)
>      */
>     if (_mesa_is_desktop_gl(ctx)) {
>        switch (ctx->Version) {
> +      case 21:
> +         ctx->Const.GLSLVersion = 120;
> +         break;

GLSL 1.20 is the minimum version supported by Mesa, so I thought we set
120 when initializing ctx->Const.  What happens if a driver only
supports OpenGL 2.0?

>        case 30:
>           ctx->Const.GLSLVersion = 130;
>           break;
> 



More information about the mesa-dev mailing list