=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Disallow disabling GLSL on core profile contexts.

Alexandre Julliard julliard at winehq.org
Mon Jun 11 13:10:51 CDT 2018


Module: wine
Branch: master
Commit: bf9a1a2e917fe6cd93340369c09a559803515050
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=bf9a1a2e917fe6cd93340369c09a559803515050

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Jun 11 13:48:56 2018 +0200

wined3d: Disallow disabling GLSL on core profile contexts.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 9bc9c31..baab2e9 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 shader backend available 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 e322b4d..f8a84a1 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 33bc463..d190f7c 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;




More information about the wine-cvs mailing list