Gallium:draw:aaline and aapoint: Restore the old hooks when we destroy our stage.
[mesa.git] / src / gallium / auxiliary / draw / draw_pipe_aapoint.c
index 60f6380c503c795dae612fec0af74e0e1c449393..9265c379de88622be55dd30aba16a4607b998c2c 100644 (file)
@@ -768,7 +768,16 @@ aapoint_reset_stipple_counter(struct draw_stage *stage)
 static void
 aapoint_destroy(struct draw_stage *stage)
 {
+   struct aapoint_stage* aapoint = aapoint_stage(stage);
+   struct pipe_context *pipe = stage->draw->pipe;
+
    draw_free_temp_verts( stage );
+
+   /* restore the old entry points */
+   pipe->create_fs_state = aapoint->driver_create_fs_state;
+   pipe->bind_fs_state = aapoint->driver_bind_fs_state;
+   pipe->delete_fs_state = aapoint->driver_delete_fs_state;
+
    FREE( stage );
 }