Module: wine
Branch: master
Commit: f89fdb4429883f869be3853a712cb14c876a5304
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f89fdb4429883f869be3853a7…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Fri Oct 29 18:15:23 2010 +0200
wined3d: Don't reapply lighting when vertex shaders are used.
If a vertex shader is used the GL_LIGHTING state is ignored. If the
shader is turned off state_vdecl is called anyway, so it will adjust the
lighting state to match the available fixed function vertex attributes.
---
dlls/wined3d/state.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 83ed0c6..9e0df6a 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4630,11 +4630,6 @@ static void vertexdeclaration(DWORD state_id, IWineD3DStateBlockImpl *stateblock
updateFog = TRUE;
}
- /* Reapply lighting if it is not scheduled for reapplication already */
- if(!isStateDirty(context, STATE_RENDER(WINED3DRS_LIGHTING))) {
- state_lighting(STATE_RENDER(WINED3DRS_LIGHTING), stateblock, context);
- }
-
if (transformed) {
context->last_was_rhw = TRUE;
} else {
@@ -4677,6 +4672,9 @@ static void vertexdeclaration(DWORD state_id, IWineD3DStateBlockImpl *stateblock
if(!isStateDirty(context, STATE_RENDER(WINED3DRS_COLORVERTEX))) {
state_colormat(STATE_RENDER(WINED3DRS_COLORVERTEX), stateblock, context);
}
+ if(!isStateDirty(context, STATE_RENDER(WINED3DRS_LIGHTING))) {
+ state_lighting(STATE_RENDER(WINED3DRS_LIGHTING), stateblock, context);
+ }
if(context->last_was_vshader) {
updateFog = TRUE;