diff options
author | Francisco Jerez <currojerez@riseup.net> | 2015-07-13 15:30:24 +0300 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2015-08-06 15:37:39 +0300 |
commit | e51f4b165ed9f20febf41a6c9b6abd1356d2fdff (patch) | |
tree | 058ef72a6fc9a1ab38d906d379756f43d20ea7d6 | |
parent | ee977183dcb543c919d0d70dde610cb191d5a3ea (diff) |
i965/fs: Remove redundant hand-unrolled first iteration of loop.
This seems rather silly and would lead to memory corruption if the
size of a VGRF was allowed to be zero.
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index ce1edc3f889..d2523a364ce 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1637,16 +1637,12 @@ fs_visitor::split_virtual_grfs() int reg = 0; for (int i = 0; i < num_vars; i++) { - /* The first one should always be 0 as a quick sanity check. */ - assert(split_points[reg] == false); + int offset = 0; - /* j = 0 case */ - new_reg_offset[reg] = 0; - reg++; - int offset = 1; + /* The first one should always be 0 as a quick sanity check. */ + assert(reg == reg_count || split_points[reg] == false); - /* j > 0 case */ - for (unsigned j = 1; j < alloc.sizes[i]; j++) { + for (unsigned j = 0; j < alloc.sizes[i]; j++) { /* If this is a split point, reset the offset to 0 and allocate a * new virtual GRF for the previous offset many registers */ |