Define destroy method called by softpipe's destructor.
authormichal <michal@michal-laptop.(none)>
Fri, 26 Oct 2007 16:25:09 +0000 (17:25 +0100)
committermichal <michal@michal-laptop.(none)>
Sat, 27 Oct 2007 18:01:11 +0000 (19:01 +0100)
12 files changed:
src/mesa/pipe/softpipe/sp_quad.h
src/mesa/pipe/softpipe/sp_quad_alpha_test.c
src/mesa/pipe/softpipe/sp_quad_blend.c
src/mesa/pipe/softpipe/sp_quad_bufloop.c
src/mesa/pipe/softpipe/sp_quad_colormask.c
src/mesa/pipe/softpipe/sp_quad_coverage.c
src/mesa/pipe/softpipe/sp_quad_depth_test.c
src/mesa/pipe/softpipe/sp_quad_fs.c
src/mesa/pipe/softpipe/sp_quad_occlusion.c
src/mesa/pipe/softpipe/sp_quad_output.c
src/mesa/pipe/softpipe/sp_quad_stencil.c
src/mesa/pipe/softpipe/sp_quad_stipple.c

index cca7dbd..5345411 100644 (file)
@@ -45,6 +45,8 @@ struct quad_stage {
 
    /** the stage action */
    void (*run)(struct quad_stage *qs, struct quad_header *quad);
+
+   void (*destroy)(struct quad_stage *qs);
 };
 
 
index 4f28414..d9b914d 100644 (file)
@@ -88,6 +88,12 @@ static void alpha_test_begin(struct quad_stage *qs)
 }
 
 
+static void alpha_test_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 struct quad_stage *
 sp_quad_alpha_test_stage( struct softpipe_context *softpipe )
 {
@@ -96,6 +102,7 @@ sp_quad_alpha_test_stage( struct softpipe_context *softpipe )
    stage->softpipe = softpipe;
    stage->begin = alpha_test_begin;
    stage->run = alpha_test_quad;
+   stage->destroy = alpha_test_destroy;
 
    return stage;
 }
index 9b7a486..cecf8af 100644 (file)
@@ -727,6 +727,12 @@ static void blend_begin(struct quad_stage *qs)
 }
 
 
+static void blend_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 struct quad_stage *sp_quad_blend_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
@@ -734,6 +740,7 @@ struct quad_stage *sp_quad_blend_stage( struct softpipe_context *softpipe )
    stage->softpipe = softpipe;
    stage->begin = blend_begin;
    stage->run = blend_quad;
+   stage->destroy = blend_destroy;
 
    return stage;
 }
index ae2fb5e..bdf491d 100644 (file)
@@ -50,6 +50,12 @@ static void cbuf_loop_begin(struct quad_stage *qs)
 }
 
 
+static void cbuf_loop_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 /**
  * Create the colorbuffer loop stage.
  * This is used to implement multiple render targets and GL_FRONT_AND_BACK
@@ -62,6 +68,7 @@ struct quad_stage *sp_quad_bufloop_stage( struct softpipe_context *softpipe )
    stage->softpipe = softpipe;
    stage->begin = cbuf_loop_begin;
    stage->run = cbuf_loop_quad;
+   stage->destroy = cbuf_loop_destroy;
 
    return stage;
 }
index 8872825..f0aa657 100644 (file)
@@ -90,6 +90,12 @@ static void colormask_begin(struct quad_stage *qs)
 }
 
 
+static void colormask_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 struct quad_stage *sp_quad_colormask_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
@@ -97,6 +103,7 @@ struct quad_stage *sp_quad_colormask_stage( struct softpipe_context *softpipe )
    stage->softpipe = softpipe;
    stage->begin = colormask_begin;
    stage->run = colormask_quad;
+   stage->destroy = colormask_destroy;
 
    return stage;
 }
index 89f50bc..25e7b03 100644 (file)
@@ -69,6 +69,12 @@ static void coverage_begin(struct quad_stage *qs)
 }
 
 
+static void coverage_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 struct quad_stage *sp_quad_coverage_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
@@ -76,6 +82,7 @@ struct quad_stage *sp_quad_coverage_stage( struct softpipe_context *softpipe )
    stage->softpipe = softpipe;
    stage->begin = coverage_begin;
    stage->run = coverage_quad;
+   stage->destroy = coverage_destroy;
 
    return stage;
 }
index 1885090..c24232b 100644 (file)
@@ -231,6 +231,12 @@ static void depth_test_begin(struct quad_stage *qs)
 }
 
 
+static void depth_test_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 struct quad_stage *sp_quad_depth_test_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
@@ -238,6 +244,7 @@ struct quad_stage *sp_quad_depth_test_stage( struct softpipe_context *softpipe )
    stage->softpipe = softpipe;
    stage->begin = depth_test_begin;
    stage->run = depth_test_quad;
+   stage->destroy = depth_test_destroy;
 
    return stage;
 }
index 9b9504c..dc8d6e0 100644 (file)
@@ -190,6 +190,12 @@ static void shade_begin(struct quad_stage *qs)
 }
 
 
+static void shade_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 struct quad_stage *sp_quad_shade_stage( struct softpipe_context *softpipe )
 {
    struct quad_shade_stage *qss = CALLOC_STRUCT(quad_shade_stage);
@@ -204,6 +210,7 @@ struct quad_stage *sp_quad_shade_stage( struct softpipe_context *softpipe )
    qss->stage.softpipe = softpipe;
    qss->stage.begin = shade_begin;
    qss->stage.run = shade_quad;
+   qss->stage.destroy = shade_destroy;
 
    /* set TGSI sampler state that's constant */
    for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
index 4f178f0..18a36e8 100644 (file)
@@ -64,6 +64,11 @@ static void occlusion_begin(struct quad_stage *qs)
 }
 
 
+static void occlusion_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
 
 struct quad_stage *sp_quad_occlusion_stage( struct softpipe_context *softpipe )
 {
@@ -72,6 +77,7 @@ struct quad_stage *sp_quad_occlusion_stage( struct softpipe_context *softpipe )
    stage->softpipe = softpipe;
    stage->begin = occlusion_begin;
    stage->run = occlusion_count_quad;
+   stage->destroy = occlusion_destroy;
 
    return stage;
 }
index f757a43..09194c1 100644 (file)
@@ -70,6 +70,12 @@ static void output_begin(struct quad_stage *qs)
 }
 
 
+static void output_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 struct quad_stage *sp_quad_output_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
@@ -77,6 +83,7 @@ struct quad_stage *sp_quad_output_stage( struct softpipe_context *softpipe )
    stage->softpipe = softpipe;
    stage->begin = output_begin;
    stage->run = output_quad;
+   stage->destroy = output_destroy;
 
    return stage;
 }
index c4240f1..14aa7df 100644 (file)
@@ -323,6 +323,12 @@ static void stencil_begin(struct quad_stage *qs)
 }
 
 
+static void stencil_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 struct quad_stage *sp_quad_stencil_test_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
@@ -330,6 +336,7 @@ struct quad_stage *sp_quad_stencil_test_stage( struct softpipe_context *softpipe
    stage->softpipe = softpipe;
    stage->begin = stencil_begin;
    stage->run = stencil_test_quad;
+   stage->destroy = stencil_destroy;
 
    return stage;
 }
index 4af5059..7916dcd 100644 (file)
@@ -65,6 +65,12 @@ static void stipple_begin(struct quad_stage *qs)
 }
 
 
+static void stipple_destroy(struct quad_stage *qs)\r
+{\r
+   free( qs );\r
+}
+
+
 struct quad_stage *
 sp_quad_polygon_stipple_stage( struct softpipe_context *softpipe )
 {
@@ -73,6 +79,7 @@ sp_quad_polygon_stipple_stage( struct softpipe_context *softpipe )
    stage->softpipe = softpipe;
    stage->begin = stipple_begin;
    stage->run = stipple_quad;
+   stage->destroy = stipple_destroy;
 
    return stage;
 }