aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-03-17 10:39:43 -0700
committerMatt Turner <[email protected]>2014-06-01 13:29:24 -0700
commitb1dcdcde2e323f960833f5c7da65d5c2c20113c9 (patch)
tree6852fd268a2aa5ad096322a9f624879bc6293bd2 /src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
parent27e12a8ea933e2f978e0ce9286422e6025c7377d (diff)
i965/fs: Loop from 0 to inst->sources, not 0 to 3.
Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp6
1 files changed, 3 insertions, 3 deletions
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 bbaf8107ec7..4ff6f18ffde 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -273,7 +273,7 @@ fs_visitor::setup_payload_interference(struct ra_graph *g,
* assign_curbe_setup(), and interpolation uses fixed hardware regs from
* the start (see interp_reg()).
*/
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == HW_REG &&
inst->src[i].fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE) {
int node_nr = inst->src[i].fixed_hw_reg.nr / reg_width;
@@ -583,7 +583,7 @@ fs_visitor::choose_spill_reg(struct ra_graph *g)
foreach_list(node, &this->instructions) {
fs_inst *inst = (fs_inst *)node;
- for (unsigned int i = 0; i < 3; i++) {
+ for (unsigned int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF) {
spill_costs[inst->src[i].reg] += loop_scale;
@@ -682,7 +682,7 @@ fs_visitor::spill_reg(int spill_reg)
foreach_list(node, &this->instructions) {
fs_inst *inst = (fs_inst *)node;
- for (unsigned int i = 0; i < 3; i++) {
+ for (unsigned int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF &&
inst->src[i].reg == spill_reg) {
int regs_read = inst->regs_read(this, i);