gskglcompiler.c: Relax check for GL 3.x+ legacy contexts
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 22 Nov 2021 10:41:58 +0000 (18:41 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 1 Dec 2021 09:29:02 +0000 (17:29 +0800)
On Windows with nVidia drivers at least, when we create a legacy context
via wglCreateContext(), we may still get a (W)GL 4.x context.  Allow
such contexts to also use GLSL version 130 instead of 110, so that
things do continue to work.

gsk/gl/gskglcompiler.c

index c885df8f4507edaa65cbb57c09369c4d09f4d18c..e341e54c7115ab4394bd5c5a23c04991f17ba784 100644 (file)
@@ -136,7 +136,8 @@ gsk_gl_compiler_new (GskGLDriver *driver,
 
       gdk_gl_context_get_version (context, &maj, &min);
 
-      if (maj == 3)
+      /* On Windows, legacy contexts can give us a GL 4.x context */
+      if (maj >= 3)
         self->glsl_version = SHADER_VERSION_GL3_LEGACY;
       else
         self->glsl_version = SHADER_VERSION_GL2_LEGACY;