summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe/sp_context.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2007-11-18 18:20:20 +0000
committerMichal Krol <[email protected]>2007-11-18 18:20:20 +0000
commit7f718f047676e88b660618784f256a96f7e8ed58 (patch)
tree0e7c6676b64df5394eb0d09073a934cc4bbaa408 /src/mesa/pipe/softpipe/sp_context.c
parentca7f68a7cf25a51f382bba8c42d8c6ab7db57b5d (diff)
Implement early depth test.
Early depth test is enabled when depth test is enabled and alpha test is disabled and fragment shader does not write depth. The early-z is implemented by moving the depth test stage just before the fragment shader stage and prepending it with an earlyz stage, introduced with this commit. The earlyz stage prepares the quad->outputs.depth for the following depth test stage by interpolating Z position, just as the fragment shader would do.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_context.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index be4da0ec64a..d5e68c189de 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -161,6 +161,7 @@ static void softpipe_destroy( struct pipe_context *pipe )
draw_destroy( softpipe->draw );
softpipe->quad.polygon_stipple->destroy( softpipe->quad.polygon_stipple );
+ softpipe->quad.earlyz->destroy( softpipe->quad.earlyz );
softpipe->quad.shade->destroy( softpipe->quad.shade );
softpipe->quad.alpha_test->destroy( softpipe->quad.alpha_test );
softpipe->quad.depth_test->destroy( softpipe->quad.depth_test );
@@ -369,6 +370,7 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
/* setup quad rendering stages */
softpipe->quad.polygon_stipple = sp_quad_polygon_stipple_stage(softpipe);
+ softpipe->quad.earlyz = sp_quad_earlyz_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);