r600g: optimise the draw emission packets for r600/eg
[mesa.git] / src / gallium / drivers / softpipe / sp_quad_pipe.c
index 594fade45577e5ee3066e9b3ab345896b5cbf149..2cfd02a22c6019e982e1cb345cc89e61f8e3b31b 100644 (file)
@@ -38,18 +38,6 @@ sp_push_quad_first( struct softpipe_context *sp,
    sp->quad.first = quad;
 }
 
-static void
-sp_build_depth_stencil( struct softpipe_context *sp )
-{
-   if (sp->depth_stencil->stencil[0].enabled ||
-       sp->depth_stencil->stencil[1].enabled) {
-      sp_push_quad_first( sp, sp->quad.stencil_test );
-   }
-   else if (sp->depth_stencil->depth.enabled &&
-            sp->framebuffer.zsbuf) {
-      sp_push_quad_first( sp, sp->quad.depth_test );
-   }
-}
 
 void
 sp_build_quad_pipeline(struct softpipe_context *sp)
@@ -59,48 +47,23 @@ sp_build_quad_pipeline(struct softpipe_context *sp)
       sp->framebuffer.zsbuf &&
       !sp->depth_stencil->alpha.enabled &&
       !sp->fs->info.uses_kill &&
-      !sp->fs->info.writes_z;
-
-   /* build up the pipeline in reverse order... */
-
-   /* Color combine
-    */
-   sp->quad.first = sp->quad.output;
-
-   if (sp->blend->colormask != 0xf) {
-      sp_push_quad_first( sp, sp->quad.colormask );
-   }
-
-   if (sp->blend->blend_enable ||
-       sp->blend->logicop_enable) {
-      sp_push_quad_first( sp, sp->quad.blend );
-   }
-
-   if (sp->rasterizer->poly_smooth ||
-       sp->rasterizer->line_smooth ||
-       sp->rasterizer->point_smooth) {
-      sp_push_quad_first( sp, sp->quad.coverage );
-   }
+      !sp->fs->info.writes_z &&
+      !sp->fs->info.writes_stencil;
 
-   /* Shade/Depth/Stencil/Alpha
-    */
-   if (sp->active_query_count) {
-      sp_push_quad_first( sp, sp->quad.occlusion );
-   }
+   sp->quad.first = sp->quad.blend;
 
-   if (!early_depth_test) {
-      sp_build_depth_stencil( sp );
+   if (early_depth_test) {
+      sp_push_quad_first( sp, sp->quad.shade );
+      sp_push_quad_first( sp, sp->quad.depth_test );
    }
-
-   if (sp->depth_stencil->alpha.enabled) {
-      sp_push_quad_first( sp, sp->quad.alpha_test );
+   else {
+      sp_push_quad_first( sp, sp->quad.depth_test );
+      sp_push_quad_first( sp, sp->quad.shade );
    }
 
-   sp_push_quad_first( sp, sp->quad.shade );
-
-   if (early_depth_test) {
-      sp_build_depth_stencil( sp );
-      sp_push_quad_first( sp, sp->quad.earlyz );
-   }
+#if !DO_PSTIPPLE_IN_DRAW_MODULE
+   if (sp->rasterizer->poly_stipple_enable)
+      sp_push_quad_first( sp, sp->quad.pstipple );
+#endif
 }