Module: Mesa
Branch: master
Commit: 75f52d1e5210944d7e92787c637285fd83533053
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=75f52d1e5210944d7e92787c637285fd83533053

Author: Francisco Jerez <curroje...@riseup.net>
Date:   Sun Mar  7 18:40:21 2010 +0100

dri/nouveau: Fix nv[12]x color sum.

---

 src/mesa/drivers/dri/nouveau/nouveau_state.c  |    1 +
 src/mesa/drivers/dri/nouveau/nv10_state_tnl.c |    6 ++++--
 src/mesa/drivers/dri/nouveau/nv20_state_tnl.c |    2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c 
b/src/mesa/drivers/dri/nouveau/nouveau_state.c
index e1871db..bc61045 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_state.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c
@@ -150,6 +150,7 @@ nouveau_enable(GLcontext *ctx, GLenum cap, GLboolean state)
                break;
        case GL_COLOR_SUM_EXT:
                context_dirty(ctx, FRAG);
+               context_dirty(ctx, LIGHT_MODEL);
                break;
        case GL_CULL_FACE:
                context_dirty(ctx, CULL_FACE);
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c 
b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c
index 6db14d8..406e24c 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c
@@ -201,8 +201,10 @@ nv10_emit_light_model(GLcontext *ctx, int emit)
        BEGIN_RING(chan, celsius, NV10TCL_LIGHT_MODEL, 1);
        OUT_RING(chan, ((m->LocalViewer ?
                         NV10TCL_LIGHT_MODEL_LOCAL_VIEWER : 0) |
-                       (m->ColorControl == GL_SEPARATE_SPECULAR_COLOR ?
-                        NV10TCL_LIGHT_MODEL_SEPARATE_SPECULAR : 0)));
+                       (NEED_SECONDARY_COLOR(ctx) ?
+                        NV10TCL_LIGHT_MODEL_SEPARATE_SPECULAR : 0) |
+                       (!ctx->Light.Enabled && ctx->Fog.ColorSumEnabled ?
+                        NV10TCL_LIGHT_MODEL_VERTEX_SPECULAR : 0)));
 }
 
 static float
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c 
b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c
index 0d56606..43f8c72 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c
@@ -158,7 +158,7 @@ nv20_emit_light_model(GLcontext *ctx, int emit)
        OUT_RING(chan, ((m->LocalViewer ?
                         NV20TCL_LIGHT_MODEL_VIEWER_LOCAL :
                         NV20TCL_LIGHT_MODEL_VIEWER_NONLOCAL) |
-                       (m->ColorControl == GL_SEPARATE_SPECULAR_COLOR ?
+                       (NEED_SECONDARY_COLOR(ctx) ?
                         NV20TCL_LIGHT_MODEL_SEPARATE_SPECULAR :
                         0)));
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to