From: Topi Pohjolainen Date: Wed, 30 Mar 2016 17:50:41 +0000 (+0300) Subject: i965/blorp: Prepare render target write for gen8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=328ab6c268b4cf8744915b96be4a6f031dc81ef9;p=mesa.git i965/blorp: Prepare render target write for gen8 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 Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 5fd25f1ffe4..444ba26a718 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -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); } diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp index fd23e23b6f8..3a5297c187e 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp @@ -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; diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h index 14a8e50611b..8ed6d6b38a5 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h @@ -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); diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 011fc420d2b..c7f20ca5646 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -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, diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index 851cccf0f7c..fb9f65c6a37 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -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: