Drivers that only support compat 3.0 were reporting GLSL 1.40
support. This fixes issues with the menu of Dawn of War II.
Fixes: a0c8b49284ef "mesa: enable OpenGL 3.1 with ARB_compatibility"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105807
/* Make sure that the GLSL version lines up with the GL version. In some
* cases it can be too high, e.g. if an extension is missing.
*/
- if (_mesa_is_desktop_gl(ctx) && ctx->Version >= 31) {
+ if (_mesa_is_desktop_gl(ctx)) {
switch (ctx->Version) {
+ case 30:
+ ctx->Const.GLSLVersion = 130;
+ break;
case 31:
ctx->Const.GLSLVersion = 140;
break;
ctx->Const.GLSLVersion = 150;
break;
default:
- ctx->Const.GLSLVersion = ctx->Version * 10;
+ if (ctx->Version >= 33)
+ ctx->Const.GLSLVersion = ctx->Version * 10;
break;
}
}