summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe/sp_context.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-07-13 09:25:57 -0600
committerBrian <[email protected]>2007-07-13 09:25:57 -0600
commit563479552e2f491fb94e7fac5772f3c72cee962a (patch)
treecc9d7617d45b14d3ff9e2b1517f64fd2b4079eeb /src/mesa/pipe/softpipe/sp_context.c
parent676fcf0de270651311a6b812e98f2e71d7dae925 (diff)
Added basic occlusion counting
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_context.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index cc4b8d59141..685e55be842 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -60,6 +60,20 @@ static void softpipe_draw_vb( struct pipe_context *pipe,
}
+static void softpipe_reset_occlusion_counter(struct pipe_context *pipe)
+{
+ struct softpipe_context *softpipe = softpipe_context( pipe );
+ softpipe->occlusion_counter = 0;
+}
+
+/* XXX pipe param should be const */
+static GLuint softpipe_get_occlusion_counter(struct pipe_context *pipe)
+{
+ struct softpipe_context *softpipe = softpipe_context( pipe );
+ return softpipe->occlusion_counter;
+}
+
+
struct pipe_context *softpipe_create( void )
{
struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context);
@@ -82,12 +96,15 @@ struct pipe_context *softpipe_create( void )
softpipe->pipe.set_viewport_state = softpipe_set_viewport_state;
softpipe->pipe.draw_vb = softpipe_draw_vb;
softpipe->pipe.clear = softpipe_clear;
+ softpipe->pipe.reset_occlusion_counter = softpipe_reset_occlusion_counter;
+ softpipe->pipe.get_occlusion_counter = softpipe_get_occlusion_counter;
softpipe->quad.polygon_stipple = sp_quad_polygon_stipple_stage(softpipe);
softpipe->quad.shade = sp_quad_shade_stage(softpipe);
softpipe->quad.alpha_test = sp_quad_alpha_test_stage(softpipe);
softpipe->quad.depth_test = sp_quad_depth_test_stage(softpipe);
softpipe->quad.stencil_test = sp_quad_stencil_test_stage(softpipe);
+ softpipe->quad.occlusion = sp_quad_occlusion_stage(softpipe);
softpipe->quad.bufloop = sp_quad_bufloop_stage(softpipe);
softpipe->quad.blend = sp_quad_blend_stage(softpipe);
softpipe->quad.colormask = sp_quad_colormask_stage(softpipe);