intel/fs: Add explicit last_rt flag to fb writes orthogonal to eot.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 13 Jan 2017 22:01:45 +0000 (14:01 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 29 May 2018 22:44:50 +0000 (15:44 -0700)
When using multiple RT write messages to the same RT such as for
dual-source blending or all RT writes in SIMD32, we have to set the
"Last Render Target Select" bit on all write messages that target the
last RT but only set EOT on the last RT write in the shader.
Special-casing for dual-source blend works today because that is the
only case which requires multiple RT write messages per RT.  When we
start doing SIMD32, this will become much more common so we add a
dedicated bit for it.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_fs_generator.cpp
src/intel/compiler/brw_fs_visitor.cpp
src/intel/compiler/brw_ir_fs.h

index 8d9278684fd2966c86858c4c12013df7aebcef84..d67c0a41922f036a152c94cc4b39bfecab2605fb 100644 (file)
@@ -3246,6 +3246,7 @@ fs_visitor::emit_repclear_shader()
       }
    }
    write->eot = true;
+   write->last_rt = true;
 
    calculate_cfg();
 
index f310a84e25ad576a324f4758d330f5a2134735fb..f49ab442fb26428d93f16827dd4bd61a71222f52 100644 (file)
@@ -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);
index 41dbd76106e79c7e3efec4ba59f9ceba7312f80d..a24808eac69c8f188d50d787d8d9a992b398d66b 100644 (file)
@@ -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;
 }
 
index f06a33c516d205599a5c0c682d6181586d76b65f..92dad269a349d223d302402cfeb46ba6bc2ff579 100644 (file)
@@ -374,6 +374,7 @@ public:
 
    uint8_t sources; /**< Number of fs_reg sources. */
 
+   bool last_rt:1;
    bool pi_noperspective:1;   /**< Pixel interpolator noperspective flag */
 };