set INTERP_CONSTANT when appropriate
authorBrian <brian.paul@tungstengraphics.com>
Fri, 13 Jul 2007 18:26:09 +0000 (12:26 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 13 Jul 2007 18:26:09 +0000 (12:26 -0600)
Not really signficant now since draw_flat stage copies the provoking
vertex color to all prim verts.

src/mesa/pipe/softpipe/sp_state_derived.c

index 34c893e396a6b72423d31670af4aed3ac585dcd0..18dfb50e381f7b0de1350b968bba3839093dd0f6 100644 (file)
@@ -90,7 +90,11 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
     */
    for (i = 1; i < FRAG_ATTRIB_TEX0; i++) {
       if (inputsRead & (i << i)) {
-        EMIT_ATTR(frag_to_vf[i], i, INTERP_LINEAR);
+         if (softpipe->setup.flatshade
+             && (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1))
+            EMIT_ATTR(frag_to_vf[i], i, INTERP_CONSTANT);
+         else
+            EMIT_ATTR(frag_to_vf[i], i, INTERP_LINEAR);
       }
    }