Module: Mesa Branch: master Commit: b0c8e5e0c88f7c5d7395715e58a8731e2ab55f7e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0c8e5e0c88f7c5d7395715e58a8731e2ab55f7e
Author: Francisco Jerez <[email protected]> Date: Fri Apr 29 19:47:44 2016 -0700 i965/fs: Pass a BAD_FILE register to the logical FB write when oMask is unused. This will let the optimizer know that the sample mask value is unused so its definition can be DCE'ed. Reviewed-by: Jason Ekstrand <[email protected]> --- src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index f5add6e..0b350d5 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -3797,7 +3797,7 @@ lower_fb_write_logical_send(const fs_builder &bld, fs_inst *inst, length++; } - if (prog_data->uses_omask) { + if (sample_mask.file != BAD_FILE) { sources[length] = fs_reg(VGRF, bld.shader->alloc.allocate(1), BRW_REGISTER_TYPE_UD); diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 25e1a44..3a49794 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -394,7 +394,8 @@ fs_visitor::emit_single_fb_write(const fs_builder &bld, const fs_reg sources[] = { color0, color1, src0_alpha, src_depth, dst_depth, src_stencil, - sample_mask, brw_imm_ud(components) + (prog_data->uses_omask ? sample_mask : fs_reg()), + brw_imm_ud(components) }; assert(ARRAY_SIZE(sources) - 1 == FB_WRITE_LOGICAL_SRC_COMPONENTS); fs_inst *write = bld.emit(FS_OPCODE_FB_WRITE_LOGICAL, fs_reg(), _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
