util: add mutex lock in u_debug_memory.c code
[mesa.git] / src / gallium / auxiliary / draw / draw_pipe_flatshade.c
index 43d1fecc4dd3d5a71468b1768d98f228ede0322c..693f2895aad9232a21fb7152fb5c1cb0ae0d664f 100644 (file)
@@ -257,10 +257,8 @@ struct draw_stage *draw_flatshade_stage( struct draw_context *draw )
    if (flatshade == NULL)
       goto fail;
 
-   if (!draw_alloc_temp_verts( &flatshade->stage, 2 ))
-      goto fail;
-
    flatshade->stage.draw = draw;
+   flatshade->stage.name = "flatshade";
    flatshade->stage.next = NULL;
    flatshade->stage.point = draw_pipe_passthrough_point;
    flatshade->stage.line = flatshade_first_line;
@@ -269,6 +267,9 @@ struct draw_stage *draw_flatshade_stage( struct draw_context *draw )
    flatshade->stage.reset_stipple_counter = flatshade_reset_stipple_counter;
    flatshade->stage.destroy = flatshade_destroy;
 
+   if (!draw_alloc_temp_verts( &flatshade->stage, 2 ))
+      goto fail;
+
    return &flatshade->stage;
 
  fail: