This function will be used to implement read_invocation (by specifying a specific channel) and read_first_invocation (by not specifying a channel). --- src/intel/compiler/brw_fs_builder.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/intel/compiler/brw_fs_builder.h b/src/intel/compiler/brw_fs_builder.h index 87394bc17b..144ee54916 100644 --- a/src/intel/compiler/brw_fs_builder.h +++ b/src/intel/compiler/brw_fs_builder.h @@ -393,7 +393,7 @@ namespace brw { * Copy any live channel from \p src to the first channel of the result. */ src_reg - emit_uniformize(const src_reg &src) const + emit_uniformize(const src_reg &src, dst_reg chan_index = dst_reg()) const { /* FIXME: We use a vector chan_index and dst to allow constant and * copy propagration to move result all the way into the consuming @@ -403,10 +403,13 @@ namespace brw { * should go back to scalar destinations here. */ const fs_builder ubld = exec_all(); - const dst_reg chan_index = vgrf(BRW_REGISTER_TYPE_UD); const dst_reg dst = vgrf(src.type); - ubld.emit(SHADER_OPCODE_FIND_LIVE_CHANNEL, chan_index); + if (chan_index.file == BAD_FILE) { + chan_index = vgrf(BRW_REGISTER_TYPE_UD); + ubld.emit(SHADER_OPCODE_FIND_LIVE_CHANNEL, chan_index); + } + ubld.emit(SHADER_OPCODE_BROADCAST, dst, src, component(chan_index, 0)); return src_reg(component(dst, 0)); -- 2.13.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev