[Mesa-dev] [PATCH] mesa: fix glsl version mismatch in compat profile

Timothy Arceri tarceri at itsqueeze.com
Tue Apr 10 21:51:27 UTC 2018


On 11/04/18 00:34, Ilia Mirkin wrote:
> What about GL 2.1 and 2.0 (and earlier where you could still have GLSL
> as an ext)? And does the GLSL version have to line up exactly for
> those? Or does this just need to be
> 
> default:
> if (ctx->Version < 31)
>    ctx->Const.GLSLVersion = MIN2(ctx->Const.GLSLVersion, 130)
> else
>    ctx->Const.GLSLVersion = ctx->Version * 10
> 
> or something along those lines.

No idea, but if this was a problem presumably it was already broken. I'm 
going to push my patch, feel free to investigate further.

> 
> On Tue, Apr 10, 2018 at 7:40 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
>> 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"
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105807
>> ---
>>   src/mesa/main/version.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
>> index 0a4e7630da6..84babd69e2f 100644
>> --- a/src/mesa/main/version.c
>> +++ b/src/mesa/main/version.c
>> @@ -620,8 +620,11 @@ _mesa_compute_version(struct gl_context *ctx)
>>      /* 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;
>> @@ -629,7 +632,8 @@ _mesa_compute_version(struct gl_context *ctx)
>>            ctx->Const.GLSLVersion = 150;
>>            break;
>>         default:
>> -         ctx->Const.GLSLVersion = ctx->Version * 10;
>> +         if (ctx->Version >= 33)
>> +            ctx->Const.GLSLVersion = ctx->Version * 10;
>>            break;
>>         }
>>      }
>> --
>> 2.17.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list