Mesa (master): i965/vs: Move base_reg_count computation to brw_alloc_reg_set().

Kenneth Graunke kwg at kemper.freedesktop.org
Mon Aug 26 18:22:28 UTC 2013


Module: Mesa
Branch: master
Commit: a149f744d9dfc116860c04ce30256f7bed96e323
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a149f744d9dfc116860c04ce30256f7bed96e323

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Aug 21 22:06:15 2013 -0700

i965/vs: Move base_reg_count computation to brw_alloc_reg_set().

We're soon going to be calling brw_alloc_reg_set() from outside of the
visitor, where we don't have the precomputed "max_grf" variable handy.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>

---

 .../drivers/dri/i965/brw_vec4_reg_allocate.cpp     |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
index 091d5c1..fbd79d0 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
@@ -97,8 +97,10 @@ vec4_visitor::reg_allocate_trivial()
 }
 
 static void
-brw_alloc_reg_set(struct brw_context *brw, int base_reg_count)
+brw_alloc_reg_set(struct brw_context *brw)
 {
+   int base_reg_count = brw->gen >= 7 ? GEN7_MRF_HACK_START : BRW_MAX_GRF;
+
    /* After running split_virtual_grfs(), almost all VGRFs will be of size 1.
     * SEND-from-GRF sources cannot be split, so we also need classes for each
     * potential message length.
@@ -177,7 +179,6 @@ vec4_visitor::reg_allocate()
 {
    unsigned int hw_reg_mapping[virtual_grf_count];
    int payload_reg_count = this->first_non_payload_grf;
-   int base_reg_count = max_grf;
 
    /* Using the trivial allocator can be useful in debugging undefined
     * register access as a result of broken optimization passes.
@@ -187,7 +188,7 @@ vec4_visitor::reg_allocate()
 
    calculate_live_intervals();
 
-   brw_alloc_reg_set(brw, base_reg_count);
+   brw_alloc_reg_set(brw);
 
    int node_count = virtual_grf_count;
    int first_payload_node = node_count;




More information about the mesa-commit mailing list