add quad_stage::begin() funcs
authorBrian <brian@i915.localnet.net>
Wed, 8 Aug 2007 17:44:06 +0000 (11:44 -0600)
committerBrian <brian@i915.localnet.net>
Wed, 8 Aug 2007 18:04:08 +0000 (12:04 -0600)
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 8c28a82..585adb4 100644 (file)
@@ -82,12 +82,20 @@ alpha_test_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void alpha_test_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
+
+
 struct quad_stage *
 sp_quad_alpha_test_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = alpha_test_begin;
    stage->run = alpha_test_quad;
 
    return stage;
index 3d097ae..ad21c27 100644 (file)
@@ -382,6 +382,11 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void blend_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
 
 
 struct quad_stage *sp_quad_blend_stage( struct softpipe_context *softpipe )
@@ -389,6 +394,7 @@ struct quad_stage *sp_quad_blend_stage( struct softpipe_context *softpipe )
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = blend_begin;
    stage->run = blend_quad;
 
    return stage;
index be32d02..91c4b70 100644 (file)
@@ -45,6 +45,13 @@ cbuf_loop_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void cbuf_loop_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
+
+
 /**
  * Create the colorbuffer loop stage.
  * This is used to implement multiple render targets and GL_FRONT_AND_BACK
@@ -55,6 +62,7 @@ struct quad_stage *sp_quad_bufloop_stage( struct softpipe_context *softpipe )
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = cbuf_loop_begin;
    stage->run = cbuf_loop_quad;
 
    return stage;
index fff6efa..da5ed8f 100644 (file)
@@ -71,6 +71,11 @@ colormask_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void colormask_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
 
 
 struct quad_stage *sp_quad_colormask_stage( struct softpipe_context *softpipe )
@@ -78,6 +83,7 @@ struct quad_stage *sp_quad_colormask_stage( struct softpipe_context *softpipe )
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = colormask_begin;
    stage->run = colormask_quad;
 
    return stage;
index cdd8890..f166276 100644 (file)
@@ -63,11 +63,19 @@ coverage_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void coverage_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
+
+
 struct quad_stage *sp_quad_coverage_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = coverage_begin;
    stage->run = coverage_quad;
 
    return stage;
index 3a8df33..904d93a 100644 (file)
@@ -156,6 +156,11 @@ depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void depth_test_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
 
 
 struct quad_stage *sp_quad_depth_test_stage( struct softpipe_context *softpipe )
@@ -163,6 +168,7 @@ struct quad_stage *sp_quad_depth_test_stage( struct softpipe_context *softpipe )
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = depth_test_begin;
    stage->run = depth_test_quad;
 
    return stage;
index f5240b6..5e4782c 100644 (file)
@@ -322,6 +322,7 @@ static void shade_begin(struct quad_stage *qs)
       qss->samplers[i].texture = softpipe->texture[i];
       qss->samplers[i].get_sample = sp_get_sample;
       qss->samplers[i].pipe = &softpipe->pipe;
+      /* init cache info here */
    }
 
    if (qs->next->begin)
index 843c462..0fc1acb 100644 (file)
@@ -56,11 +56,20 @@ occlusion_count_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void occlusion_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
+
+
+
 struct quad_stage *sp_quad_occlusion_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = occlusion_begin;
    stage->run = occlusion_count_quad;
 
    return stage;
index 12ab1ec..4916199 100644 (file)
@@ -84,11 +84,19 @@ output_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void output_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
+
+
 struct quad_stage *sp_quad_output_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = output_begin;
    stage->run = output_quad;
 
    return stage;
index 0b37474..6a9ea90 100644 (file)
@@ -275,6 +275,11 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void stencil_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
 
 
 struct quad_stage *sp_quad_stencil_test_stage( struct softpipe_context *softpipe )
@@ -282,6 +287,7 @@ struct quad_stage *sp_quad_stencil_test_stage( struct softpipe_context *softpipe
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = stencil_begin;
    stage->run = stencil_test_quad;
 
    return stage;
index cad1a14..286eb1c 100644 (file)
@@ -36,12 +36,20 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad)
 }
 
 
+static void stipple_begin(struct quad_stage *qs)
+{
+   if (qs->next->begin)
+      qs->next->begin(qs->next);
+}
+
+
 struct quad_stage *
 sp_quad_polygon_stipple_stage( struct softpipe_context *softpipe )
 {
    struct quad_stage *stage = CALLOC_STRUCT(quad_stage);
 
    stage->softpipe = softpipe;
+   stage->begin = stipple_begin;
    stage->run = stipple_quad;
 
    return stage;