gallium/draw: whitespace and comments
[mesa.git] / src / gallium / auxiliary / draw / draw_pipe_clip.c
index 3265dcd154a90964ced2f5f48c2bf0c65a073d4e..a6fb4556f41d80d00ff7b043247a4891211b17c2 100644 (file)
@@ -92,6 +92,7 @@ static void interp_attr( float *fdst,
    fdst[3] = LINTERP( t, fout[3], fin[3] );
 }
 
+
 static void copy_colors( struct draw_stage *stage,
                         struct vertex_header *dst,
                         const struct vertex_header *src )
@@ -114,8 +115,8 @@ static void interp( const struct clipper *clip,
                    const struct vertex_header *out, 
                    const struct vertex_header *in )
 {
-   const unsigned nr_attrs = clip->stage.draw->vs.num_vs_outputs;
-   const unsigned pos_attr = clip->stage.draw->vs.position_output;
+   const unsigned nr_attrs = draw_current_shader_outputs(clip->stage.draw);
+   const unsigned pos_attr = draw_current_shader_position_output(clip->stage.draw);
    unsigned j;
 
    /* Vertex header.
@@ -179,7 +180,7 @@ static void emit_poly( struct draw_stage *stage,
       header.v[2] = inlist[0]; /* keep in v[2] for flatshading */
 
       if (i == n-1)
-        header.flags |= edge_last;
+         header.flags |= edge_last;
 
       if (0) {
          const struct draw_vertex_shader *vs = stage->draw->vs.vertex_shader;
@@ -200,13 +201,14 @@ static void emit_poly( struct draw_stage *stage,
    }
 }
 
+
 static INLINE float
 dot4(const float *a, const float *b)
 {
-   return (a[0]*b[0] +
-           a[1]*b[1] +
-           a[2]*b[2] +
-           a[3]*b[3]);
+   return (a[0] * b[0] +
+           a[1] * b[1] +
+           a[2] * b[2] +
+           a[3] * b[3]);
 }
 
 
@@ -280,6 +282,7 @@ do_clip_tri( struct draw_stage *stage,
         dp_prev = dp;
       }
 
+      /* swap in/out lists */
       {
         struct vertex_header **tmp = inlist;
         inlist = outlist;
@@ -291,15 +294,11 @@ do_clip_tri( struct draw_stage *stage,
    /* If flat-shading, copy color to new provoking vertex.
     */
    if (clipper->flat && inlist[0] != header->v[2]) {
-      if (1) {
-        inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
-      }
+      inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
 
       copy_colors(stage, inlist[0], header->v[2]);
    }
 
-
-
    /* Emit the polygon as triangles to the setup stage:
     */
    if (n >= 3)
@@ -416,6 +415,7 @@ clip_tri( struct draw_stage *stage,
    }
 }
 
+
 /* Update state.  Could further delay this until we hit the first
  * primitive that really requires clipping.
  */
@@ -496,6 +496,7 @@ struct draw_stage *draw_clip_stage( struct draw_context *draw )
       goto fail;
 
    clipper->stage.draw = draw;
+   clipper->stage.name = "clipper";
    clipper->stage.point = clip_point;
    clipper->stage.line = clip_first_line;
    clipper->stage.tri = clip_first_tri;