r600g/compute Improve debugging output
[mesa.git] / src / gallium / drivers / softpipe / sp_quad_pipe.c
index 6fae7d552f80a4bdd57c30a1fff12b71d7470d60..0c4506ae8f4b3c3690b819c9f1cb8595d1bbec22 100644 (file)
 #include "sp_state.h"
 #include "pipe/p_shader_tokens.h"
 
+
 static void
-sp_push_quad_first( struct softpipe_context *sp,
-                    struct quad_stage *quad )
+insert_stage_at_head(struct softpipe_context *sp, struct quad_stage *quad)
 {
    quad->next = sp->quad.first;
    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)
@@ -58,49 +46,24 @@ sp_build_quad_pipeline(struct softpipe_context *sp)
       sp->depth_stencil->depth.enabled &&
       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 );
-   }
+      !sp->fs_variant->info.uses_kill &&
+      !sp->fs_variant->info.writes_z &&
+      !sp->fs_variant->info.writes_stencil;
 
-   if (sp->blend->blend_enable ||
-       sp->blend->logicop_enable) {
-      sp_push_quad_first( sp, sp->quad.blend );
-   }
-
-   if ((sp->rasterizer->poly_smooth && sp->reduced_prim == PIPE_PRIM_TRIANGLES) ||
-       (sp->rasterizer->line_smooth && sp->reduced_prim == PIPE_PRIM_LINES) ||
-       (sp->rasterizer->point_smooth && sp->reduced_prim == PIPE_PRIM_POINTS)) {
-      sp_push_quad_first( sp, sp->quad.coverage );
-   }
-
-   /* 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) {
+      insert_stage_at_head( sp, sp->quad.shade );
+      insert_stage_at_head( sp, sp->quad.depth_test );
    }
-
-   if (sp->depth_stencil->alpha.enabled) {
-      sp_push_quad_first( sp, sp->quad.alpha_test );
+   else {
+      insert_stage_at_head( sp, sp->quad.depth_test );
+      insert_stage_at_head( 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 && !DO_PSTIPPLE_IN_HELPER_MODULE
+   if (sp->rasterizer->poly_stipple_enable)
+      insert_stage_at_head( sp, sp->quad.pstipple );
+#endif
 }