Module: Mesa Branch: master Commit: 4171ef371a25fccf9e96c0908a4848ea79dcfef2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4171ef371a25fccf9e96c0908a4848ea79dcfef2
Author: Francisco Jerez <curroje...@riseup.net> Date: Wed Apr 22 14:46:17 2015 +0300 i965/fs: Fix offset() for registers with zero stride. stride == 0 implies that the register has one channel per vector component. Reviewed-by: Matt Turner <matts...@gmail.com> --- src/mesa/drivers/dri/i965/brw_ir_fs.h | 5 +++-- 1 file changed, 3 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 f3dfe79..a98f4e3 100644 --- a/src/mesa/drivers/dri/i965/brw_ir_fs.h +++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h @@ -131,14 +131,15 @@ horiz_offset(fs_reg reg, unsigned delta) static inline fs_reg offset(fs_reg reg, unsigned delta) { - assert(reg.stride > 0); switch (reg.file) { case BAD_FILE: break; case GRF: case MRF: case ATTR: - return byte_offset(reg, delta * reg.width * reg.stride * type_sz(reg.type)); + return byte_offset(reg, + delta * MAX2(reg.width * reg.stride, 1) * + type_sz(reg.type)); case UNIFORM: reg.reg_offset += delta; break; _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit