[PATCH] WineD3D: Make sure the pixel shader is compiled=0A=

Stefan Doesinger stefan at codeweavers.com
Wed Aug 13 14:32:48 CDT 2008

If we're heading out of the pixelshader handler early, and a=0A=
pixel shader is in use, the pixel shader may not be compiled. The=0A=
vertex shader handler then checks if the pixel shader is dirty,=0A=
and calls the shader backend to apply the shader if it isn't.=0A=
Thus, in the case of GLSL, the shader code could attempt to link=0A=
an uncompiled shader into the program. This isn't much of a=0A=
problem because when the fog is applied, the pixel shader is=0A=
compiled and the program re-linked.=0A=
The deeper issue is that the state handler has to deal with=0A=
getting the vertex and pixel shaders up to date. This should=0A=
instead be handled by the GLSL shader backend, with=0A=
information supplied by the state management(other shader backends=0A=
don't need the linking).=0A=
 dlls/wined3d/arb_program_shader.c |    7 ++++++-=0A=
 1 files changed, 6 insertions(+), 1 deletions(-)=0A=
diff --git a/dlls/wined3d/arb_program_shader.c =
index e553828..bc8d3b3 100644=0A=
--- a/dlls/wined3d/arb_program_shader.c=0A=
+++ b/dlls/wined3d/arb_program_shader.c=0A=
@@ -2776,7 +2776,12 @@ static void fragment_prog_arbfp(DWORD state, =
IWineD3DStateBlockImpl *stateblock,=0A=
     struct arbfp_ffp_desc *desc;=0A=
     unsigned int i;=0A=
-    if(isStateDirty(context, STATE_RENDER(WINED3DRS_FOGENABLE))) return;=0A=
+    if(isStateDirty(context, STATE_RENDER(WINED3DRS_FOGENABLE))) {=0A=
+        if(use_pshader) {=0A=
+            IWineD3DPixelShader_CompileShader(stateblock->pixelShader);=0A=
+        }=0A=
+        return;=0A=
+    }=0A=
     if(use_pshader) {=0A=
-- =0A=


More information about the wine-patches mailing list