i965/fs: set virtual_grf_count in assign_regs()
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 8 Aug 2014 23:25:34 +0000 (16:25 -0700)
committerMatt Turner <mattst88@gmail.com>
Sun, 10 Aug 2014 22:00:53 +0000 (15:00 -0700)
This lets us call dump_instructions() after register allocation without
failing an assertion.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp

index 2233621b3cd995fe727a4e38331c43fa7bdd13bf..d62627153c275d4692c0e4ba07fa2c762f5b4cd1 100644 (file)
@@ -64,6 +64,8 @@ fs_visitor::assign_regs_trivial()
    if (this->grf_used >= max_grf) {
       fail("Ran out of regs on trivial allocator (%d/%d)\n",
           this->grf_used, max_grf);
+   } else {
+      this->virtual_grf_count = this->grf_used;
    }
 
 }
@@ -523,6 +525,8 @@ fs_visitor::assign_regs(bool allow_spilling)
       }
    }
 
+   this->virtual_grf_count = this->grf_used;
+
    ralloc_free(g);
 
    return true;