[Mesa-dev] [PATCH 08/47] (0009) i965/fs: Add explicit last_rt flag to fb writes orthogonal to eot.

Shaofeng Tang shaofeng.tang at intel.com
Mon May 21 03:29:42 UTC 2018


From: Kevin Rogovin <kevin.rogovin at intel.com>

Change-Id: I5e70a326820e1252c87af07033c1c4eec1587171
---
 src/intel/compiler/brw_fs.cpp           | 7 +++++++
 src/intel/compiler/brw_fs_generator.cpp | 6 +-----
 src/intel/compiler/brw_fs_visitor.cpp   | 2 ++
 src/intel/compiler/brw_ir_fs.h          | 2 ++
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index fc41604..7e72024 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -418,6 +418,12 @@ fs_inst::can_change_types() const
             !src[1].abs && !src[1].negate));
 }
 
+bool
+fs_inst::has_side_effects() const
+{
+   return this->eot || this->last_rt || backend_instruction::has_side_effects();
+}
+
 void
 fs_reg::init()
 {
@@ -3241,6 +3247,7 @@ fs_visitor::emit_repclear_shader()
       }
    }
    write->eot = true;
+   write->last_rt = true;
 
    calculate_cfg();
 
diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp
index d46f948..eacb2a3 100644
--- a/src/intel/compiler/brw_fs_generator.cpp
+++ b/src/intel/compiler/brw_fs_generator.cpp
@@ -289,10 +289,6 @@ fs_generator::fire_fb_write(fs_inst *inst,
     */
    const uint32_t surf_index = inst->target;
 
-   bool last_render_target = inst->eot ||
-                             (prog_data->dual_src_blend && dispatch_width == 16);
-
-
    brw_fb_WRITE(p,
                 payload,
                 implied_header,
@@ -301,7 +297,7 @@ fs_generator::fire_fb_write(fs_inst *inst,
                 nr,
                 0,
                 inst->eot,
-                last_render_target,
+                inst->last_rt,
                 inst->header_size != 0);
 
    brw_mark_surface_used(&prog_data->base, surf_index);
diff --git a/src/intel/compiler/brw_fs_visitor.cpp b/src/intel/compiler/brw_fs_visitor.cpp
index 2805ec2..b4880df 100644
--- a/src/intel/compiler/brw_fs_visitor.cpp
+++ b/src/intel/compiler/brw_fs_visitor.cpp
@@ -103,6 +103,7 @@ fs_visitor::emit_dummy_fs()
    fs_inst *write;
    write = bld.emit(FS_OPCODE_FB_WRITE);
    write->eot = true;
+   write->last_rt = true;
    if (devinfo->gen >= 6) {
       write->base_mrf = 2;
       write->mlen = 4 * reg_width;
@@ -459,6 +460,7 @@ fs_visitor::emit_fb_writes()
       inst->target = 0;
    }
 
+   inst->last_rt = true;
    inst->eot = true;
 }
 
diff --git a/src/intel/compiler/brw_ir_fs.h b/src/intel/compiler/brw_ir_fs.h
index f06a33c..6595735 100644
--- a/src/intel/compiler/brw_ir_fs.h
+++ b/src/intel/compiler/brw_ir_fs.h
@@ -355,6 +355,7 @@ public:
    unsigned size_read(int arg) const;
    bool can_do_source_mods(const struct gen_device_info *devinfo);
    bool can_change_types() const;
+   bool has_side_effects() const;
    bool has_source_and_destination_hazard() const;
 
    /**
@@ -374,6 +375,7 @@ public:
 
    uint8_t sources; /**< Number of fs_reg sources. */
 
+   bool last_rt:1;
    bool pi_noperspective:1;   /**< Pixel interpolator noperspective flag */
 };
 
-- 
2.7.4



More information about the mesa-dev mailing list