[PATCH 2/2] wined3d: Limit GLSL version to 1.30 when OpenGL 3 is not supported.

Matteo Bruni mbruni at codeweavers.com
Wed Oct 30 10:11:43 CDT 2019


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
Virtualbox's OpenGL passthrough apparently advertises GLSL 4.50 on a
GL 2.1 driver. We can't really take advantage of newer GLSL without
the corresponding OpenGL support so just limit the GLSL version and
avoid further trouble.

 dlls/wined3d/adapter_gl.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 0415099439c..77051f24b1d 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -3735,6 +3735,12 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
         /* The format of the GLSL version string is "major.minor[.release] [vendor info]". */
         sscanf(str, "%u.%u", &major, &minor);
         gl_info->glsl_version = MAKEDWORD_VERSION(major, minor);
+        if (gl_info->glsl_version > MAKEDWORD_VERSION(1, 30) && gl_version < MAKEDWORD_VERSION(3, 0))
+        {
+            WARN("OpenGL version %u.%u too low, limiting GLSL version to 1.30.\n",
+                    gl_version >> 16, gl_version & 0xffff);
+            gl_info->glsl_version = MAKEDWORD_VERSION(1, 30);
+        }
         if (gl_info->glsl_version >= MAKEDWORD_VERSION(1, 30))
             gl_info->supported[WINED3D_GLSL_130] = TRUE;
     }
-- 
2.21.0




More information about the wine-devel mailing list