summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_builder.h
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2015-07-13 15:52:28 +0300
committerFrancisco Jerez <currojerez@riseup.net>2015-07-21 17:54:00 +0300
commitfadf34773527779eef4622b2586d87ec00476c0f (patch)
tree5d898957c4ac0875bd344201864a93ec793dcadd /src/mesa/drivers/dri/i965/brw_fs_builder.h
parent9383664a9cbc5bc4858fc50d7fa565f43028d779 (diff)
downloadexternal_mesa3d-fadf34773527779eef4622b2586d87ec00476c0f.zip
external_mesa3d-fadf34773527779eef4622b2586d87ec00476c0f.tar.gz
external_mesa3d-fadf34773527779eef4622b2586d87ec00476c0f.tar.bz2
i965: Fix stride field for the result of emit_uniformize().
This is essentially the same problem fixed in an earlier patch for immediates. Setting the stride to zero will be particularly useful for my future SIMD lowering pass, because we will be able to just check whether the stride of a source register is zero and skip emitting the copies required to unzip it in that case. Instead of setting stride to zero in every caller of emit_uniformize() I've changed the function to return the result as its return value (previously it was being written into a caller-provided destination register), because this way we can enforce that the result is used with the correct regioning from the function itself. The changes to the prototype of its VEC4 counterpart are mainly for the sake of symmetry, VEC4 registers don't have stride. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_builder.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_builder.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_builder.h b/src/mesa/drivers/dri/i965/brw_fs_builder.h
index 34646d7..c4ee9d4 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_builder.h
+++ b/src/mesa/drivers/dri/i965/brw_fs_builder.h
@@ -350,17 +350,19 @@ namespace brw {
}
/**
- * Copy any live channel from \p src to the first channel of \p dst.
+ * Copy any live channel from \p src to the first channel of the result.
*/
- void
- emit_uniformize(const dst_reg &dst, const src_reg &src) const
+ src_reg
+ emit_uniformize(const src_reg &src) const
{
const fs_builder ubld = exec_all();
- const dst_reg chan_index = vgrf(BRW_REGISTER_TYPE_UD);
+ const dst_reg chan_index = component(vgrf(BRW_REGISTER_TYPE_UD), 0);
+ const dst_reg dst = component(vgrf(src.type), 0);
+
+ ubld.emit(SHADER_OPCODE_FIND_LIVE_CHANNEL, chan_index);
+ ubld.emit(SHADER_OPCODE_BROADCAST, dst, src, chan_index);
- ubld.emit(SHADER_OPCODE_FIND_LIVE_CHANNEL, component(chan_index, 0));
- ubld.emit(SHADER_OPCODE_BROADCAST, component(dst, 0),
- src, component(chan_index, 0));
+ return src_reg(dst);
}
/**