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>
/* 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);
}
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;
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);
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,
}
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,
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: