summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTopi Pohjolainen <topi.pohjolainen@intel.com>2016-03-30 20:50:41 +0300
committerTopi Pohjolainen <topi.pohjolainen@intel.com>2016-04-21 08:40:33 +0300
commit328ab6c268b4cf8744915b96be4a6f031dc81ef9 (patch)
treeef63b7f86af67334b1cfc12856abe56e69f19c0e /src
parent135f00e666fdc505d8b3f68cd673cde736ea35ee (diff)
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 <topi.pohjolainen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp3
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h2
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h2
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_generator.cpp9
5 files changed, 10 insertions, 8 deletions
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: