[Mesa-dev] [PATCH v2 2/2] i965: Add an INTEL_DEBUG=spill option to test spilling

Jason Ekstrand jason.ekstrand at intel.com
Thu Apr 23 14:07:14 PDT 2015


---
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 2 +-
 src/mesa/drivers/dri/i965/intel_debug.c           | 1 +
 src/mesa/drivers/dri/i965/intel_debug.h           | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index dc433b0..94e1a0a 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -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) {
diff --git a/src/mesa/drivers/dri/i965/intel_debug.c b/src/mesa/drivers/dri/i965/intel_debug.c
index a5b883c..19be464 100644
--- a/src/mesa/drivers/dri/i965/intel_debug.c
+++ b/src/mesa/drivers/dri/i965/intel_debug.c
@@ -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 }
 };
 
diff --git a/src/mesa/drivers/dri/i965/intel_debug.h b/src/mesa/drivers/dri/i965/intel_debug.h
index a741a16..e0e9cb7 100644
--- a/src/mesa/drivers/dri/i965/intel_debug.h
+++ b/src/mesa/drivers/dri/i965/intel_debug.h
@@ -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"
-- 
2.3.5



More information about the mesa-dev mailing list