From 6012475e5999bee20d0418dcaf016d6729191b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 19 Jan 2009 12:29:49 +0100 Subject: [PATCH] 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(+) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 33619b6cddd..f1e82309c8c 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 4fe543045fc..55552089c6c 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 c3344f65183..6b36a3df168 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)) {