[Mesa-dev] [PATCH] mesa: avoid _mesa_problem invocation when running on drivers without glsl

Ian Romanick idr at freedesktop.org
Fri Jul 5 04:55:53 UTC 2019


On 7/4/19 4:21 PM, Ilia Mirkin wrote:
> For example wine might query GL_SHADING_LANGUAGE_VERSION on a driver
> that doesn't support GLSL. This is not a problem in itself, we can just
> return a INVALID_ENUM error.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109524
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/mesa/main/getstring.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
> index 3d5ae0b694b..6c0dd9048da 100644
> --- a/src/mesa/main/getstring.c
> +++ b/src/mesa/main/getstring.c
> @@ -150,6 +150,8 @@ _mesa_GetString( GLenum name )
>        case GL_SHADING_LANGUAGE_VERSION:
>           if (ctx->API == API_OPENGLES)
>              break;
> +         if (_mesa_is_desktop_gl(ctx) && ctx->Const.GLSLVersion == 0)
> +            break;

GLSL version should never be zero.  We advertise GL_ARB_shading_language
in all drivers, so every driver has "GLSL" even if it doesn't have
vertex shaders or fragment shaders.  I thought I sent out a patch some
time ago that set GLSLVersion to 120 by default to avoid problems like this.

>  	 return shading_language_version(ctx);
>        case GL_PROGRAM_ERROR_STRING_ARB:
>           if (ctx->API == API_OPENGL_COMPAT &&
> 



More information about the mesa-dev mailing list