diff options
author | Kenneth Graunke <[email protected]> | 2015-11-11 22:37:53 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-11-13 15:17:58 -0800 |
commit | f88c175a29bb287d41ef90343eb6670525475a06 (patch) | |
tree | 87989442ae58fafef467d46ddf97506f114b404a | |
parent | 26f9469a46585f64b24fb1037aaae7c757a5e6e1 (diff) |
i965: Make convert_attr_sources_to_hw_regs handle stride == 0.
This makes expressions like component(fs_reg(ATTR, n), 7) get a proper
<0,1,0> region instead of the invalid <0,8,0>.
Nobody uses this today, but I plan to.
v2: Rebase on Matt's changes; simplify.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]> [v1]
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index b8c88f73dfa..b8d48dadde9 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1614,11 +1614,12 @@ fs_visitor::convert_attr_sources_to_hw_regs(fs_inst *inst) inst->src[i].nr + inst->src[i].reg_offset; + unsigned width = inst->src[i].stride == 0 ? 1 : inst->exec_size; struct brw_reg reg = stride(byte_offset(retype(brw_vec8_grf(grf, 0), inst->src[i].type), inst->src[i].subreg_offset), inst->exec_size * inst->src[i].stride, - inst->exec_size, inst->src[i].stride); + width, inst->src[i].stride); reg.abs = inst->src[i].abs; reg.negate = inst->src[i].negate; |