[PATCH 7/7] wined3d: Disallow disabling GLSL on core profile contexts.

Józef Kucia joseph.kucia at gmail.com
Mon Jun 11 05:05:12 CDT 2018


From: Józef Kucia <jkucia at codeweavers.com>

For bug 45315.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/directx.c         | 9 ++++++++-
 dlls/wined3d/wined3d_main.c    | 4 ++--
 dlls/wined3d/wined3d_private.h | 2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 9bc9c31e0a43..9642d7d03813 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2608,7 +2608,14 @@ static const struct fragment_pipeline *select_fragment_implementation(const stru
 
 static const struct wined3d_shader_backend_ops *select_shader_backend(const struct wined3d_gl_info *gl_info)
 {
-    BOOL glsl = wined3d_settings.glslRequested && gl_info->glsl_version >= MAKEDWORD_VERSION(1, 20);
+    BOOL glsl = wined3d_settings.use_glsl && gl_info->glsl_version >= MAKEDWORD_VERSION(1, 20);
+    if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] && !wined3d_settings.use_glsl)
+    {
+        ERR_(winediag)("Ignoring the UseGLSL registry key. "
+                "GLSL is the only supported shader backend on core profile contexts. "
+                "You need to explicitly set GL version to use legacy contexts.\n");
+        glsl = TRUE;
+    }
 
     if (glsl && gl_info->supported[ARB_VERTEX_SHADER] && gl_info->supported[ARB_FRAGMENT_SHADER])
         return &glsl_shader_backend;
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index e322b4de0744..f8a84a17adb4 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -225,8 +225,8 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
             if (!strcmp(buffer,"disabled"))
             {
                 ERR_(winediag)("The GLSL shader backend has been disabled. You get to keep all the pieces if it breaks.\n");
-                TRACE("Use of GL Shading Language disabled\n");
-                wined3d_settings.glslRequested = FALSE;
+                TRACE("Use of GL Shading Language disabled.\n");
+                wined3d_settings.use_glsl = FALSE;
             }
         }
         if (!get_config_key(hkey, appkey, "OffscreenRenderingMode", buffer, size)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 33bc463b94c3..d190f7ccfd68 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -385,7 +385,7 @@ struct wined3d_settings
     unsigned int cs_multithreaded;
     BOOL explicit_gl_version;
     DWORD max_gl_version;
-    BOOL glslRequested;
+    BOOL use_glsl;
     int offscreen_rendering_mode;
     unsigned short pci_vendor_id;
     unsigned short pci_device_id;
-- 
2.16.4




More information about the wine-devel mailing list