summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-09-01 19:27:12 -0700
committerFrancisco Jerez <[email protected]>2016-09-14 14:50:56 -0700
commitee930c0435b1996fc828654608315aed2aa05229 (patch)
tree53f3bca6103d184bf0afa0ac75242519e3602ba5 /src/mesa
parentbae3a411712d815bf8b8d4526c72c174512086d3 (diff)
i965/fs: Simplify byte_offset().
In the most common case this can now be implemented as a simple addition because the offset is already encoded as a single scalar value in bytes. Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_ir_fs.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
index 721c2eb34e8..e8e25b98c58 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
@@ -79,17 +79,13 @@ byte_offset(fs_reg reg, unsigned delta)
break;
case VGRF:
case ATTR:
- case UNIFORM: {
- const unsigned reg_size = (reg.file == UNIFORM ? 4 : REG_SIZE);
- const unsigned suboffset = reg.offset % reg_size + delta;
- reg.offset += ROUND_DOWN_TO(suboffset, reg_size);
- reg.offset = ROUND_DOWN_TO(reg.offset, reg_size) + suboffset % reg_size;
+ case UNIFORM:
+ reg.offset += delta;
break;
- }
case MRF: {
- const unsigned suboffset = reg.offset % REG_SIZE + delta;
+ const unsigned suboffset = reg.offset + delta;
reg.nr += suboffset / REG_SIZE;
- reg.offset = ROUND_DOWN_TO(reg.offset, REG_SIZE) + suboffset % REG_SIZE;
+ reg.offset = suboffset % REG_SIZE;
break;
}
case ARF: