[Mesa-dev] [PATCH 8/9] i965: teach fs generator to handle simd16 replicated write

Topi Pohjolainen topi.pohjolainen at intel.com
Wed Nov 27 13:13:19 PST 2013


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_fs.h             |  1 +
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 7991b87..1095ad9 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -511,6 +511,7 @@ public:
 private:
    void generate_code(exec_list *instructions);
    void generate_fb_write(fs_inst *inst);
+   void generate_fb_write_simd16_replicated(fs_inst *inst);
    void generate_pixel_xy(struct brw_reg dst, bool is_x);
    void generate_linterp(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 467d255..10c9e45 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -190,6 +190,26 @@ fs_generator::generate_fb_write(fs_inst *inst)
    mark_surface_used(surf_index);
 }
 
+void
+fs_generator::generate_fb_write_simd16_replicated(fs_inst *inst)
+{
+   uint32_t surf_index =
+      c->prog_data.binding_table.render_target_start + inst->target;
+   brw_fb_WRITE(
+      p,
+      16,
+      inst->base_mrf,
+      retype(vec16(brw_message_reg(inst->base_mrf)), BRW_REGISTER_TYPE_F),
+      BRW_DATAPORT_RENDER_TARGET_WRITE_SIMD16_SINGLE_SOURCE_REPLICATED,
+      surf_index,
+      inst->mlen,
+      0,
+      inst->eot,
+      false);
+
+   mark_surface_used(surf_index);
+}
+
 /* Computes the integer pixel x,y values from the origin.
  *
  * This is the basis of gl_FragCoord computation, but is also used
@@ -1704,6 +1724,10 @@ fs_generator::generate_code(exec_list *instructions)
 	 generate_fb_write(inst);
 	 break;
 
+      case FS_OPCODE_FB_WRITE_SIMD16_REPLICATED:
+         generate_fb_write_simd16_replicated(inst);
+         break;
+
       case FS_OPCODE_MOV_DISPATCH_TO_FLAGS:
          generate_mov_dispatch_to_flags(inst);
          break;
-- 
1.8.3.1



More information about the mesa-dev mailing list