summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-10-29 13:58:45 -0700
committerMatt Turner <mattst88@gmail.com>2014-12-01 16:42:13 -0800
commitb37273b92431a2d986235774f04a9fba2aa1bf74 (patch)
tree60e2fe60bb77359d6d6cf8aa739ae1190d65a564 /src/mesa/drivers/dri/i965/brw_fs_live_variables.h
parent60d507c3c5c7caed57119df0ab4d824ad1ea85dc (diff)
i965/fs: Use const fs_reg & rather than a copy or pointer.
Also while we're touching var_from_reg, just make it an inline function. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_live_variables.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_live_variables.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.h b/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
index 2bfb583233e..a52f922d959 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
@@ -66,7 +66,10 @@ public:
~fs_live_variables();
bool vars_interfere(int a, int b);
- int var_from_reg(fs_reg *reg);
+ int var_from_reg(const fs_reg &reg) const
+ {
+ return var_from_vgrf[reg.reg] + reg.reg_offset;
+ }
/** Map from virtual GRF number to index in block_data arrays. */
int *var_from_vgrf;
@@ -96,8 +99,10 @@ public:
protected:
void setup_def_use();
- void setup_one_read(struct block_data *bd, fs_inst *inst, int ip, fs_reg reg);
- void setup_one_write(struct block_data *bd, fs_inst *inst, int ip, fs_reg reg);
+ void setup_one_read(struct block_data *bd, fs_inst *inst, int ip,
+ const fs_reg &reg);
+ void setup_one_write(struct block_data *bd, fs_inst *inst, int ip,
+ const fs_reg &reg);
void compute_live_variables();
void compute_start_end();