draw: Add an assertion to varray's version of trim().
[mesa.git] / src / gallium / auxiliary / draw / draw_pipe_twoside.c
index c329d9233908e6f6c39fbfff26249f653dc73c69..9a3f3fee625c793b513761b5d185eb7c8e7ff1b1 100644 (file)
@@ -141,7 +141,7 @@ static void twoside_first_tri( struct draw_stage *stage,
     * if the triangle is back-facing (negative).
     * sign = -1 for CCW, +1 for CW
     */
-   twoside->sign = (stage->draw->rasterizer->front_winding == PIPE_WINDING_CCW) ? -1.0f : 1.0f;
+   twoside->sign = stage->draw->rasterizer->front_ccw ? -1.0f : 1.0f;
 
    stage->tri = twoside_tri;
    stage->tri( stage, header );
@@ -177,10 +177,8 @@ struct draw_stage *draw_twoside_stage( struct draw_context *draw )
    if (twoside == NULL)
       goto fail;
 
-   if (!draw_alloc_temp_verts( &twoside->stage, 3 ))
-      goto fail;
-
    twoside->stage.draw = draw;
+   twoside->stage.name = "twoside";
    twoside->stage.next = NULL;
    twoside->stage.point = draw_pipe_passthrough_point;
    twoside->stage.line = draw_pipe_passthrough_line;
@@ -189,6 +187,9 @@ struct draw_stage *draw_twoside_stage( struct draw_context *draw )
    twoside->stage.reset_stipple_counter = twoside_reset_stipple_counter;
    twoside->stage.destroy = twoside_destroy;
 
+   if (!draw_alloc_temp_verts( &twoside->stage, 3 ))
+      goto fail;
+
    return &twoside->stage;
 
  fail: