i965/blorp: Prepare render target write for gen8
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 30 Mar 2016 17:50:41 +0000 (20:50 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 21 Apr 2016 05:40:33 +0000 (08:40 +0300)
v2 (Ken): Use payload directly instead of retyping it into vec8.
          Drop the implied header, it isn't used for gen6+ anyway.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_generator.cpp

index 5fd25f1ffe415289f58197202e316e2cf6b5d607..444ba26a71894aad85f2a3926071f175f33b0f61 100644 (file)
@@ -1786,7 +1786,7 @@ brw_blorp_blit_program::render_target_write()
    /* Now write to the render target and terminate the thread */
    emit_render_target_write(
       mrf_rt_write,
-      base_mrf,
+      brw->gen < 8 ? base_mrf : -1,
       mrf_offset /* msg_length.  TODO: Should be smaller for non-RGBA formats. */,
       use_header);
 }
index fd23e23b6f859587302eb106c59b02f95dfdc25e..3a5297c187ef13522d1fb5d69458e721cc71bee7 100644 (file)
@@ -96,13 +96,14 @@ brw_blorp_eu_emitter::emit_texture_lookup(const struct brw_reg &dst,
 
 void
 brw_blorp_eu_emitter::emit_render_target_write(const struct brw_reg &src0,
-                                               unsigned msg_reg_nr,
+                                               int msg_reg_nr,
                                                unsigned msg_length,
                                                bool use_header)
 {
    fs_inst *inst = new (mem_ctx) fs_inst(FS_OPCODE_BLORP_FB_WRITE, 16);
 
    inst->src[0] = src0;
+   inst->sources = 1;
    inst->base_mrf = msg_reg_nr;
    inst->mlen = msg_length;
    inst->header_size = use_header ? 2 : 0;
index 14a8e50611b47a66a772c37457d709c78f153dae..8ed6d6b38a5934c4d8c378544c2820c76f07ec45 100644 (file)
@@ -47,7 +47,7 @@ protected:
                             unsigned msg_length);
 
    void emit_render_target_write(const struct brw_reg &src0,
-                                 unsigned msg_reg_nr,
+                                 int msg_reg_nr,
                                  unsigned msg_length,
                                  bool use_header);
 
index 011fc420d2ba8328f887cf7595e0a89ed783aff2..c7f20ca5646474bb45fe2fed971e1931ded10c4e 100644 (file)
@@ -449,7 +449,7 @@ private:
    void generate_stencil_ref_packing(fs_inst *inst, struct brw_reg dst,
                                      struct brw_reg src);
    void generate_barrier(fs_inst *inst, struct brw_reg src);
-   void generate_blorp_fb_write(fs_inst *inst);
+   void generate_blorp_fb_write(fs_inst *inst, struct brw_reg payload);
    void generate_linterp(fs_inst *inst, struct brw_reg dst,
                         struct brw_reg *src);
    void generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src,
index 851cccf0f7c5437a0f4b61a94330ac4ea956bbd8..fb9f65c6a3749f2baecdb7903b60b055765c13bc 100644 (file)
@@ -552,12 +552,13 @@ fs_generator::generate_barrier(fs_inst *inst, struct brw_reg src)
 }
 
 void
-fs_generator::generate_blorp_fb_write(fs_inst *inst)
+fs_generator::generate_blorp_fb_write(fs_inst *inst, struct brw_reg payload)
 {
    brw_fb_WRITE(p,
                 16 /* dispatch_width */,
-                brw_message_reg(inst->base_mrf),
-                brw_reg_from_fs_reg(inst, &inst->src[0], devinfo->gen),
+                inst->base_mrf >= 0 ?
+                   brw_message_reg(inst->base_mrf) : payload,
+                brw_null_reg(),
                 BRW_DATAPORT_RENDER_TARGET_WRITE_SIMD16_SINGLE_SOURCE,
                 inst->target,
                 inst->mlen,
@@ -2192,7 +2193,7 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
         break;
 
       case FS_OPCODE_BLORP_FB_WRITE:
-        generate_blorp_fb_write(inst);
+        generate_blorp_fb_write(inst, src[0]);
         break;
 
       case FS_OPCODE_MOV_DISPATCH_TO_FLAGS: