i965: Add an INTEL_DEBUG=spill option to test spilling
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 23 Apr 2015 18:49:27 +0000 (11:49 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 24 Apr 2015 01:08:21 +0000 (18:08 -0700)
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
src/mesa/drivers/dri/i965/intel_debug.c
src/mesa/drivers/dri/i965/intel_debug.h

index dc433b0..94e1a0a 100644 (file)
@@ -627,7 +627,7 @@ fs_visitor::assign_regs(bool allow_spilling)
    }
 
    /* Debug of register spilling: Go spill everything. */
-   if (0) {
+   if (unlikely(INTEL_DEBUG & DEBUG_SPILL)) {
       int reg = choose_spill_reg(g);
 
       if (reg != -1) {
index a5b883c..19be464 100644 (file)
@@ -69,6 +69,7 @@ static const struct dri_debug_control debug_control[] = {
    { "ann",         DEBUG_ANNOTATION },
    { "no8",         DEBUG_NO8 },
    { "vec4vs",      DEBUG_VEC4VS },
+   { "spill",       DEBUG_SPILL },
    { NULL,    0 }
 };
 
index a741a16..e0e9cb7 100644 (file)
@@ -64,6 +64,7 @@ extern uint64_t INTEL_DEBUG;
 #define DEBUG_ANNOTATION          (1ull << 28)
 #define DEBUG_NO8                 (1ull << 29)
 #define DEBUG_VEC4VS              (1ull << 30)
+#define DEBUG_SPILL               (1ull << 31)
 
 #ifdef HAVE_ANDROID_PLATFORM
 #define LOG_TAG "INTEL-MESA"