diff options
author | Eric Anholt <eric@anholt.net> | 2012-01-27 12:59:24 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2012-02-07 10:20:07 -0800 |
commit | 1b5e151ffae3ff50e9012243b7fcbbb60c3a0042 (patch) | |
tree | 9cb69c7ffaba921a2dc9f4aa6d8e04f8a3988dd7 | |
parent | 20da01fecdd2379bd6df1407d1c344aa8ddd5c45 (diff) |
i965/vs: Avoid allocating registers in to the gen7 MRF hack region.
This is the corresponding fix to the previous one for the FS, but I
don't have a particular test for it.
NOTE: This is a candidate for the 8.0 branch.
(cherry picked from commit 9195191e50429d9cf25e6498f9fb108758ac2be6)
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index 2555fa71059..bc8b3923bc0 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_vec4.h @@ -334,6 +334,7 @@ public: int virtual_grf_count; int virtual_grf_array_size; int first_non_payload_grf; + unsigned int max_grf; int *virtual_grf_def; int *virtual_grf_use; dst_reg userplane[MAX_CLIP_PLANES]; 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 2efe235bff9..57b05192b35 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp @@ -87,9 +87,9 @@ vec4_visitor::reg_allocate_trivial() assign(hw_reg_mapping, &inst->src[2]); } - if (prog_data->total_grf > BRW_MAX_GRF) { + if (prog_data->total_grf > max_grf) { fail("Ran out of regs on trivial allocator (%d/%d)\n", - prog_data->total_grf, BRW_MAX_GRF); + prog_data->total_grf, max_grf); } } @@ -144,7 +144,7 @@ vec4_visitor::reg_allocate() { int hw_reg_mapping[virtual_grf_count]; int first_assigned_grf = this->first_non_payload_grf; - int base_reg_count = BRW_MAX_GRF - first_assigned_grf; + int base_reg_count = max_grf - first_assigned_grf; int class_sizes[base_reg_count]; int class_count = 0; diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index d3c93978231..3f6939b6753 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -2601,6 +2601,8 @@ vec4_visitor::vec4_visitor(struct brw_vs_compile *c, this->virtual_grf_array_size = 0; this->live_intervals_valid = false; + this->max_grf = intel->gen >= 7 ? GEN7_MRF_HACK_START : BRW_MAX_GRF; + this->uniforms = 0; } |