svga: add new begin_blit()
[mesa.git] / src / gallium / drivers / svga / svga_state_need_swtnl.c
index cac39d62fd1b55291898b73b734e074d72465a2d..b07c62da40546f758cf1f9d6df16479d76770289 100644 (file)
@@ -26,6 +26,7 @@
 #include "util/u_inlines.h"
 #include "pipe/p_state.h"
 #include "svga_context.h"
+#include "svga_shader.h"
 #include "svga_state.h"
 #include "svga_debug.h"
 #include "svga_hw_reg.h"
@@ -61,6 +62,7 @@ update_need_pipeline(struct svga_context *svga, unsigned dirty)
 {
    boolean need_pipeline = FALSE;
    struct svga_vertex_shader *vs = svga->curr.vs;
+   const char *reason = "";
 
    /* SVGA_NEW_RAST, SVGA_NEW_REDUCED_PRIMITIVE
     */
@@ -75,6 +77,20 @@ update_need_pipeline(struct svga_context *svga, unsigned dirty)
                  svga->curr.rast->need_pipeline_lines_str,
                  svga->curr.rast->need_pipeline_points_str);
       need_pipeline = TRUE;
+
+      switch (svga->curr.reduced_prim) {
+      case PIPE_PRIM_POINTS:
+         reason = svga->curr.rast->need_pipeline_points_str;
+         break;
+      case PIPE_PRIM_LINES:
+         reason = svga->curr.rast->need_pipeline_lines_str;
+         break;
+      case PIPE_PRIM_TRIANGLES:
+         reason = svga->curr.rast->need_pipeline_tris_str;
+         break;
+      default:
+         assert(!"Unexpected reduced prim type");
+      }
    }
 
    /* EDGEFLAGS
@@ -82,6 +98,7 @@ update_need_pipeline(struct svga_context *svga, unsigned dirty)
     if (vs && vs->base.info.writes_edgeflag) {
       SVGA_DBG(DEBUG_SWTNL, "%s: edgeflags\n", __FUNCTION__);
       need_pipeline = TRUE;
+      reason = "edge flags";
    }
 
    /* SVGA_NEW_FS, SVGA_NEW_RAST, SVGA_NEW_REDUCED_PRIMITIVE
@@ -91,7 +108,7 @@ update_need_pipeline(struct svga_context *svga, unsigned dirty)
       unsigned generic_inputs =
          svga->curr.fs ? svga->curr.fs->generic_inputs : 0;
 
-      if (sprite_coord_gen &&
+      if (!svga_have_vgpu10(svga) && sprite_coord_gen &&
           (generic_inputs & ~sprite_coord_gen)) {
          /* The fragment shader is using some generic inputs that are
           * not being replaced by auto-generated point/sprite coords (and
@@ -103,6 +120,7 @@ update_need_pipeline(struct svga_context *svga, unsigned dirty)
           * point stage.
           */
          need_pipeline = TRUE;
+         reason = "point sprite coordinate generation";
       }
    }
 
@@ -115,6 +133,12 @@ update_need_pipeline(struct svga_context *svga, unsigned dirty)
    if (0 && svga->state.sw.need_pipeline)
       debug_printf("sw.need_pipeline = %d\n", svga->state.sw.need_pipeline);
 
+   if (svga->state.sw.need_pipeline) {
+      assert(reason);
+      pipe_debug_message(&svga->debug.callback, FALLBACK,
+                         "Using semi-fallback for %s", reason);
+   }
+
    return PIPE_OK;
 }