NV30/NV40 CMP and SCS src == dst handling
[mesa.git] / src / gallium / drivers / i965 / brw_urb.c
index a2277519ad7fa2675e82054b9056d509f9eeb079..907ec56c6ca4cec9af658ff6130deb0d261c9083 100644 (file)
@@ -35,6 +35,7 @@
 #include "brw_context.h"
 #include "brw_state.h"
 #include "brw_defines.h"
+#include "brw_debug.h"
 
 #define VS 0
 #define GS 1
@@ -83,7 +84,7 @@
  * XXX: Verify min_nr_entries, esp for VS.
  * XXX: Verify SF min_entry_size.
  */
-static const struct {
+static const struct urb_limits {
    GLuint min_nr_entries;
    GLuint preferred_nr_entries;
    GLuint min_entry_size;
@@ -111,7 +112,7 @@ static GLboolean check_urb_layout( struct brw_context *brw )
 /* Most minimal update, forces re-emit of URB fence packet after GS
  * unit turned on/off.
  */
-static void recalculate_urb_fence( struct brw_context *brw )
+static int recalculate_urb_fence( struct brw_context *brw )
 {
    GLuint csize = brw->curbe.total_size;
    GLuint vsize = brw->vs.prog_data->urb_entry_size;
@@ -166,6 +167,15 @@ static void recalculate_urb_fence( struct brw_context *brw )
         }
       }
 
+      if (BRW_DEBUG & DEBUG_MIN_URB) {
+        brw->urb.nr_vs_entries = limits[VS].min_nr_entries;    
+        brw->urb.nr_gs_entries = limits[GS].min_nr_entries;    
+        brw->urb.nr_clip_entries = limits[CLP].min_nr_entries;
+        brw->urb.nr_sf_entries = limits[SF].min_nr_entries;    
+        brw->urb.nr_cs_entries = limits[CS].min_nr_entries;    
+        brw->urb.constrained = 1;
+      }
+
       if (!check_urb_layout(brw)) {
         brw->urb.nr_vs_entries = limits[VS].min_nr_entries;    
         brw->urb.nr_gs_entries = limits[GS].min_nr_entries;    
@@ -184,17 +194,17 @@ static void recalculate_urb_fence( struct brw_context *brw )
             * entries and the values for minimum nr of entries
             * provided above.
             */
-           _mesa_printf("couldn't calculate URB layout!\n");
+           debug_printf("couldn't calculate URB layout!\n");
            exit(1);
         }
         
-        if (INTEL_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS))
-           _mesa_printf("URB CONSTRAINED\n");
+        if (BRW_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS))
+           debug_printf("URB CONSTRAINED\n");
       }
 
 done:
-      if (INTEL_DEBUG & DEBUG_URB)
-        _mesa_printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
+      if (BRW_DEBUG & DEBUG_URB)
+        debug_printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
                      brw->urb.vs_start,
                      brw->urb.gs_start,
                      brw->urb.clip_start,
@@ -204,6 +214,8 @@ done:
       
       brw->state.dirty.brw |= BRW_NEW_URB_FENCE;
    }
+
+   return 0;
 }