wined3d: Move the GLSL registry check again

Jason Green jave27 at gmail.com
Thu May 25 23:33:13 CDT 2006


Phil Costin's patch did make things better than they were, but this
part of the code still wasn't executed in apps that didn't check the
Device Caps.  It needs to be in order for my upcoming batch of GLSL
shader patches to work.  Currently, everything is just using the
GL_SUPPORT(ARB_VERTEX_PROGRAM) check to determine if certain parts of
the code should execute.  I will be changing those lookups to use the
wined3d_settings.shader_mode flag in this patch instead.

This patch moves the registry/hardware-support lookups to the Device
Init3D() function instead.  We know that will have to execute once in
order to use shaders at all.
-------------- next part --------------
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 07edde1..e35d9ed 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1733,6 +1733,16 @@ #endif
     }
 
 
+    /* Determine shader mode to use based on GL caps */
+    if (GL_SUPPORT(ARB_SHADING_LANGUAGE_100) && wined3d_settings.glslRequested
+        && (wined3d_settings.vs_mode == VS_HW || wined3d_settings.ps_mode == PS_HW))
+        wined3d_settings.shader_mode = SHADER_GLSL;
+    else if ((GL_SUPPORT(ARB_VERTEX_PROGRAM) && wined3d_settings.vs_mode == VS_HW) ||
+              (GL_SUPPORT(ARB_FRAGMENT_PROGRAM) && wined3d_settings.ps_mode == PS_HW))
+        wined3d_settings.shader_mode = SHADER_ARB;
+    else
+        wined3d_settings.shader_mode = SHADER_SW;
+
     /* Initialize the current view state */
     This->modelview_valid = 1;
     This->proj_valid = 0;
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 0bb5589..ec9c5d7 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1696,16 +1696,6 @@ #endif
     *pCaps->MaxStreams          = MAX_STREAMS;
     *pCaps->MaxStreamStride     = 1024;
 
-    /* Determine shader mode to use based on GL caps */
-    if (GL_SUPPORT(ARB_SHADING_LANGUAGE_100) && wined3d_settings.glslRequested
-       && (wined3d_settings.vs_mode == VS_HW || wined3d_settings.ps_mode == PS_HW))
-            wined3d_settings.shader_mode = SHADER_GLSL;
-    else if ((GL_SUPPORT(ARB_VERTEX_PROGRAM) && wined3d_settings.vs_mode == VS_HW) ||
-             (GL_SUPPORT(ARB_FRAGMENT_PROGRAM) && wined3d_settings.ps_mode == PS_HW))
-        wined3d_settings.shader_mode = SHADER_ARB;
-    else
-        wined3d_settings.shader_mode = SHADER_SW;
-
     if (wined3d_settings.vs_mode == VS_HW && wined3d_settings.shader_mode == SHADER_GLSL
          && DeviceType != WINED3DDEVTYPE_REF) {
         *pCaps->VertexShaderVersion = D3DVS_VERSION(3,0);







More information about the wine-patches mailing list