Stefan Dösinger : wined3d: Properly update last_was_pshader.

Alexandre Julliard julliard at winehq.org
Tue Feb 24 10:21:44 CST 2009


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Mon Jan 19 12:29:49 2009 +0100

wined3d: Properly update last_was_pshader.

---

 dlls/wined3d/arb_program_shader.c  |    3 +++
 dlls/wined3d/ati_fragment_shader.c |    1 +
 dlls/wined3d/state.c               |    2 ++
 3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 33619b6..f1e8230 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -3031,6 +3031,9 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock,
             state_texfactor_arbfp(STATE_RENDER(WINED3DRS_TEXTUREFACTOR), stateblock, context);
             state_arb_specularenable(STATE_RENDER(WINED3DRS_SPECULARENABLE), stateblock, context);
         }
+        context->last_was_pshader = FALSE;
+    } else {
+        context->last_was_pshader = TRUE;
     }
 
     /* Finally, select the shader. If a pixel shader is used, it will be set and enabled by the shader backend.
diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c
index 4fe5430..5555208 100644
--- a/dlls/wined3d/ati_fragment_shader.c
+++ b/dlls/wined3d/ati_fragment_shader.c
@@ -885,6 +885,7 @@ static void atifs_apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *statebl
     IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
     BOOL use_vshader = use_vs(stateblock);
 
+    context->last_was_pshader = use_ps(stateblock);
     /* The ATIFS code does not support pixel shaders currently, but we have to provide a state handler
      * to call shader_select to select a vertex shader if one is applied because the vertex shader state
      * may defer calling the shader backend if the pshader state is dirty.
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index c3344f6..6b36a3d 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3408,6 +3408,7 @@ void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DC
                     sampler(STATE_SAMPLER(i), stateblock, context);
                 }
             }
+            context->last_was_pshader = TRUE;
         } else {
            /* Otherwise all samplers were activated by the code above in earlier draws, or by sampler()
             * if a different texture was bound. I don't have to do anything.
@@ -3423,6 +3424,7 @@ void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DC
                         (STATE_TEXTURESTAGE(i, WINED3DTSS_COLOROP), stateblock, context);
             }
         }
+        context->last_was_pshader = FALSE;
     }
 
     if(!isStateDirty(context, device->StateTable[STATE_VSHADER].representative)) {




More information about the wine-cvs mailing list