dri/nouveau: Fix nv[12]x color sum.
authorFrancisco Jerez <currojerez@riseup.net>
Sun, 7 Mar 2010 17:40:21 +0000 (18:40 +0100)
committerFrancisco Jerez <currojerez@riseup.net>
Sun, 7 Mar 2010 21:40:11 +0000 (22:40 +0100)
src/mesa/drivers/dri/nouveau/nouveau_state.c
src/mesa/drivers/dri/nouveau/nv10_state_tnl.c
src/mesa/drivers/dri/nouveau/nv20_state_tnl.c

index e1871db0eb9466c194bbb3d2370f22e3c2e6e9ae..bc610451b403d6bae828856d613880106daa623a 100644 (file)
@@ -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);
index 6db14d83b83f7ff6bb79a3cfe19c15e80f061150..406e24c455d3d73bb658b072080cb046af26d774 100644 (file)
@@ -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
index 0d566064f6776d10c46c02d9a1595fabe5c41970..43f8c7231226fc8712919f4e0a9d680690f1cf56 100644 (file)
@@ -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)));