Stefan Dösinger : wined3d: Close a pshader on-off switching loophole.

Alexandre Julliard julliard at winehq.org
Fri Sep 5 06:57:54 CDT 2008


Module: wine
Branch: master
Commit: 271f56c9f142da4cf370e5cbb6d2d0015751495a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=271f56c9f142da4cf370e5cbb6d2d0015751495a

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed Sep  3 16:07:37 2008 -0500

wined3d: Close a pshader on-off switching loophole.

---

 dlls/wined3d/arb_program_shader.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index ca65e3e..7fa88c0 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -2912,6 +2912,13 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock,
     if(isStateDirty(context, STATE_RENDER(WINED3DRS_FOGENABLE))) {
         if(use_pshader) {
             IWineD3DPixelShader_CompileShader(stateblock->pixelShader);
+        } else if(device->shader_backend == &arb_program_shader_backend && context->last_was_pshader) {
+            /* Reload fixed function constants since they collide with the pixel shader constants */
+            for(i = 0; i < MAX_TEXTURES; i++) {
+                set_bumpmat_arbfp(STATE_TEXTURESTAGE(i, WINED3DTSS_BUMPENVMAT00), stateblock, context);
+            }
+            state_texfactor_arbfp(STATE_RENDER(WINED3DRS_TEXTUREFACTOR), stateblock, context);
+            state_arb_specularenable(STATE_RENDER(WINED3DRS_SPECULARENABLE), stateblock, context);
         }
         return;
     }




More information about the wine-cvs mailing list