diff options
author | Francisco Jerez <currojerez@riseup.net> | 2016-09-07 17:00:07 -0700 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2016-09-14 14:50:53 -0700 |
commit | e1a918ba7be6b21303caa2d81671f2d3f17dd692 (patch) | |
tree | 19e1a7927355fb25ca96ce7adec637a767ce8c9d /src/mesa/drivers/dri/i965/brw_ir_fs.h | |
parent | 27cb6b081eaffcf786686136f7961c4d78cc5586 (diff) | |
download | external_mesa3d-e1a918ba7be6b21303caa2d81671f2d3f17dd692.zip external_mesa3d-e1a918ba7be6b21303caa2d81671f2d3f17dd692.tar.gz external_mesa3d-e1a918ba7be6b21303caa2d81671f2d3f17dd692.tar.bz2 |
i965/fs: Replace fs_inst::regs_read with ::size_read using byte units.
The previous regs_read value can be recovered by rewriting each
reference of regs_read() like 'x = i.regs_read(j)' to 'x =
DIV_ROUND_UP(i.size_read(j), reg_unit)'.
For the same reason as in the previous patches, this doesn't attempt
to be particularly clever about simplifying the result in the interest
of keeping the rather lengthy patch as obvious as possible. I'll come
back later to clean up any ugliness introduced here.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_ir_fs.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_ir_fs.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h index cea81e4..2e5c8e5 100644 --- a/src/mesa/drivers/dri/i965/brw_ir_fs.h +++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h @@ -324,7 +324,7 @@ public: bool is_partial_write() const; bool is_copy_payload(const brw::simple_allocator &grf_alloc) const; unsigned components_read(unsigned i) const; - int regs_read(int arg) const; + int size_read(int arg) const; bool can_do_source_mods(const struct gen_device_info *devinfo); bool can_change_types() const; bool has_side_effects() const; @@ -435,7 +435,9 @@ inline unsigned regs_read(const fs_inst *inst, unsigned i) { /* XXX - Take into account register-misaligned offsets correctly. */ - return inst->regs_read(i); + const unsigned reg_size = + inst->src[i].file == UNIFORM || inst->src[i].file == IMM ? 4 : REG_SIZE; + return DIV_ROUND_UP(inst->size_read(i), reg_size); } #endif |