[0.4.11][WINED3D] Workaround regression CORE-15408
authorJoachim Henze <Joachim.Henze@reactos.org>
Sun, 4 Oct 2020 15:10:13 +0000 (17:10 +0200)
committerJoachim Henze <Joachim.Henze@reactos.org>
Sun, 4 Oct 2020 15:10:13 +0000 (17:10 +0200)
Many 3D applications crashed with 'WineD3D fake window' msgbox
if they were used in VirtualBox with graphics driver
'VBoxDisp.sys from VM guest additions + installed 3D acceleration'

That was a regression of SVN r75847 == git 0.4.7-dev-319-g
3d13ed394efdd0ce0aef4e10965b1d08334394ec

Contrary we had no such issues with the SW emulation.
The reason for the bug is that
VBoxDisp only supports OpenGL 2.1 (GLSL 120) and WineD3D
tried to use shaders for OpenGL 3.2 (GLSL 150).

This workaround disables the usage in a hard-coded way for
all graphics adapters. Should be ok for now, as ros does not
really support any modern GPU drivers yet.
Proper working runtime detection would be better ofc.

Thx to Doug Lyons & Fabian Maurer

Fix cherry picked from 0.4.14-dev-113-g
082f230ac76087915355c962a307f21ade9dae96

dll/directx/wine/wined3d/utils.c

index b48293e..3c6d218 100644 (file)
@@ -2183,7 +2183,14 @@ static void draw_test_quad(struct wined3d_caps_gl_ctx *ctx, const struct wined3d
 
     if (!ctx->test_program_id)
     {
+#ifdef __REACTOS__
+        /* workaround CORE-15408 crash for many 3D applications.
+           VBoxDisp with enabled 3D acceleration only supports OpenGL 2.1 (GLSL 120).
+           Wine must not use shaders for OpenGL 3.2 (GLSL 150). */
+        BOOL use_glsl_150 = FALSE;
+#else
         BOOL use_glsl_150 = gl_info->glsl_version >= MAKEDWORD_VERSION(1, 50);
+#endif
 
         ctx->test_program_id = GL_EXTCALL(glCreateProgram());