[WINED3D 3] Only link and use GLSL programs if at least one GLSL shader is available.

Ivan Gyurdiev ivg231 at gmail.com
Tue Jul 4 02:24:19 CDT 2006


I remember I ran into problems without this check... which is possible, 
because the code will try to link and use a program even if both shaders 
are not suitable to attach. For example there could be a software vertex 
shader, and pixel shaders could be disabled. This seems like a bad thing 
- skip GLSL program building of no GLSL shader is available and enabled.
-------------- next part --------------
---
 dlls/wined3d/drawprim.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 95ccc77..ff1c23c 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -1962,8 +1962,8 @@ #endif
         TRACE("Loaded arrays\n");
 
         /* Bind the correct GLSL shader program based on the currently set vertex & pixel shaders. */
-        if (wined3d_settings.vs_selected_mode == SHADER_GLSL ||
-            wined3d_settings.ps_selected_mode == SHADER_GLSL) {
+        if ((useVertexShaderFunction && wined3d_settings.vs_selected_mode == SHADER_GLSL) ||
+            (usePixelShaderFunction && wined3d_settings.ps_selected_mode == SHADER_GLSL)) {
 
             set_glsl_shader_program(iface);
             /* Start using this program ID (if it's 0, there is no shader program to use, so 
-- 
1.4.0



More information about the wine-patches mailing list