[Mesa-dev] [v2 06/23] i965/blorp: move emission of rt-write into eu-emitter

Topi Pohjolainen topi.pohjolainen at intel.com
Wed Jan 22 09:16:58 PST 2014


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp    | 15 +++++----------
 src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp | 18 ++++++++++++++++++
 src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h   |  5 +++++
 3 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 034a82b..4bbdf3d 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -1954,16 +1954,11 @@ brw_blorp_blit_program::render_target_write()
    }
 
    /* Now write to the render target and terminate the thread */
-   brw_fb_WRITE(&func,
-                16 /* dispatch_width */,
-                base_mrf /* msg_reg_nr */,
-                mrf_rt_write /* src0 */,
-                BRW_DATAPORT_RENDER_TARGET_WRITE_SIMD16_SINGLE_SOURCE,
-                BRW_BLORP_RENDERBUFFER_BINDING_TABLE_INDEX,
-                mrf_offset /* msg_length.  TODO: Should be smaller for non-RGBA formats. */,
-                0 /* response_length */,
-                true /* eot */,
-                use_header);
+   emit_render_target_write(
+      mrf_rt_write,
+      base_mrf, 
+      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 ff45b6a..df8d63d 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
@@ -134,3 +134,21 @@ brw_blorp_eu_emitter::emit_texture_lookup(const struct brw_reg &dst,
               BRW_SAMPLER_SIMD_MODE_SIMD16,
               BRW_SAMPLER_RETURN_FORMAT_FLOAT32);
 }
+
+void
+brw_blorp_eu_emitter::emit_render_target_write(const struct brw_reg &src0,
+                                               unsigned msg_reg_nr,
+                                               unsigned msg_length,
+                                               bool use_header)
+{
+   brw_fb_WRITE(&func,
+                16 /* dispatch_width */,
+                msg_reg_nr,
+                src0,
+                BRW_DATAPORT_RENDER_TARGET_WRITE_SIMD16_SINGLE_SOURCE,
+                BRW_BLORP_RENDERBUFFER_BINDING_TABLE_INDEX,
+                msg_length,
+                0 /* response_length */,
+                true /* eot */,
+                use_header);
+}
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 9e7c43f..5f0c8cf 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
@@ -47,6 +47,11 @@ protected:
                             unsigned base_mrf,
                             unsigned msg_length);
 
+   void emit_render_target_write(const struct brw_reg &src0,
+                                 unsigned msg_reg_nr,
+                                 unsigned msg_length,
+                                 bool use_header);
+
    void *mem_ctx;
    struct brw_compile func;
 };
-- 
1.8.3.1



More information about the mesa-dev mailing list