Mesa (master): Gallium:draw:aaline and aapoint: Restore the old hooks when we destroy our stage.

Stephane Marchesin marcheu at kemper.freedesktop.org
Wed Jun 29 23:55:19 UTC 2011


Module: Mesa
Branch: master
Commit: 5349b95920c82ab9187fe965f3921bd564fe6524
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5349b95920c82ab9187fe965f3921bd564fe6524

Author: Stéphane Marchesin <marcheu at chromium.org>
Date:   Tue Jun 28 20:45:07 2011 -0700

Gallium:draw:aaline and aapoint: Restore the old hooks when we destroy our stage.

---

 src/gallium/auxiliary/draw/draw_pipe_aaline.c  |    8 ++++++++
 src/gallium/auxiliary/draw/draw_pipe_aapoint.c |    9 +++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index 32af29a..458f85d 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -784,6 +784,14 @@ aaline_destroy(struct draw_stage *stage)
 
    draw_free_temp_verts( stage );
 
+   /* restore the old entry points */
+   pipe->create_fs_state = aaline->driver_create_fs_state;
+   pipe->bind_fs_state = aaline->driver_bind_fs_state;
+   pipe->delete_fs_state = aaline->driver_delete_fs_state;
+
+   pipe->bind_fragment_sampler_states = aaline->driver_bind_sampler_states;
+   pipe->set_fragment_sampler_views = aaline->driver_set_sampler_views;
+
    FREE( stage );
 }
 
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
index 60f6380..9265c37 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
@@ -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 );
 }
 




More information about the mesa-commit mailing list