i965/fs: Lower 32x32 bit multiplication on BXT.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_interpolation_map.c
index 7b7dbef135461286f286016eb0ada83a5910e8f9..b5da6f5ea3b7f9ce5a71571acf13fd38efcf2244 100644 (file)
 
 #include "brw_state.h"
 
+static char const *get_qual_name(int mode)
+{
+   switch (mode) {
+      case INTERP_QUALIFIER_NONE:          return "none";
+      case INTERP_QUALIFIER_FLAT:          return "flat";
+      case INTERP_QUALIFIER_SMOOTH:        return "smooth";
+      case INTERP_QUALIFIER_NOPERSPECTIVE: return "nopersp";
+      default:                             return "???";
+   }
+}
+
 
 /* Set up interpolation modes for every element in the VUE */
 static void
@@ -33,7 +44,7 @@ brw_setup_vue_interpolation(struct brw_context *brw)
 
    memset(&brw->interpolation_mode, INTERP_QUALIFIER_NONE, sizeof(brw->interpolation_mode));
 
-   brw->state.dirty.brw |= BRW_NEW_INTERPOLATION_MAP;
+   brw->ctx.NewDriverState |= BRW_NEW_INTERPOLATION_MAP;
 
    if (!fprog)
       return;
@@ -72,14 +83,30 @@ brw_setup_vue_interpolation(struct brw_context *brw)
 
       brw->interpolation_mode.mode[i] = mode;
    }
+
+   if (unlikely(INTEL_DEBUG & DEBUG_VUE)) {
+      fprintf(stderr, "VUE map:\n");
+      for (int i = 0; i < vue_map->num_slots; i++) {
+         int varying = vue_map->slot_to_varying[i];
+         if (varying == -1) {
+            fprintf(stderr, "%d: --\n", i);
+            continue;
+         }
+
+         fprintf(stderr, "%d: %d %s ofs %d\n",
+                 i, varying,
+                 get_qual_name(brw->interpolation_mode.mode[i]),
+                 brw_vue_slot_to_offset(i));
+      }
+   }
 }
 
 
 const struct brw_tracked_state brw_interpolation_map = {
    .dirty = {
       .mesa  = _NEW_LIGHT,
-      .brw   = (BRW_NEW_FRAGMENT_PROGRAM |
-                BRW_NEW_VUE_MAP_GEOM_OUT)
+      .brw   = BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_VUE_MAP_GEOM_OUT,
    },
    .emit = brw_setup_vue_interpolation
 };