[Mesa-dev] [PATCH 15/16] i965/blorp: Move vertex uploading for parameter type to handle

Topi Pohjolainen topi.pohjolainen at intel.com
Thu Apr 23 11:00:40 PDT 2015


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_blorp.h    |  6 ++----
 src/mesa/drivers/dri/i965/gen6_blorp.cpp | 11 +++++------
 src/mesa/drivers/dri/i965/gen7_blorp.cpp |  2 +-
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h
index 238a966..c005bdf 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp.h
@@ -227,6 +227,8 @@ public:
 
    virtual void gen7_emit_ps_config(struct brw_context *brw) const;
 
+   virtual void gen6_emit_vertices(struct brw_context *brw) const;
+
    uint32_t x0;
    uint32_t y0;
    uint32_t x1;
@@ -398,10 +400,6 @@ void
 gen6_blorp_emit_state_base_address(struct brw_context *brw,
                                    const brw_blorp_params *params);
 
-void
-gen6_blorp_emit_vertices(struct brw_context *brw,
-                         const brw_blorp_params *params);
-
 uint32_t
 gen6_blorp_emit_blend_state(struct brw_context *brw,
                             const brw_blorp_params *params);
diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
index 612a06d..3b18001 100644
--- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
@@ -126,8 +126,7 @@ gen6_blorp_emit_vertex_buffer_state(struct brw_context *brw,
 }
 
 void
-gen6_blorp_emit_vertices(struct brw_context *brw,
-                         const brw_blorp_params *params)
+brw_blorp_params::gen6_emit_vertices(struct brw_context *brw) const
 {
    uint32_t vertex_offset;
 
@@ -164,9 +163,9 @@ gen6_blorp_emit_vertices(struct brw_context *brw,
       float *vertex_data;
 
       const float vertices[GEN6_BLORP_VBO_SIZE] = {
-         /* v0 */ 0, 0, 0, 0,     (float) params->x0, (float) params->y1, 0, 1,
-         /* v1 */ 0, 0, 0, 0,     (float) params->x1, (float) params->y1, 0, 1,
-         /* v2 */ 0, 0, 0, 0,     (float) params->x0, (float) params->y0, 0, 1,
+         /* v0 */ 0, 0, 0, 0,     (float) x0, (float) y1, 0, 1,
+         /* v1 */ 0, 0, 0, 0,     (float) x1, (float) y1, 0, 1,
+         /* v2 */ 0, 0, 0, 0,     (float) x0, (float) y0, 0, 1,
       };
 
       vertex_data = (float *) brw_state_batch(brw, AUB_TRACE_VERTEX_BUFFER,
@@ -1098,7 +1097,7 @@ gen6_blorp_exec(struct brw_context *brw,
                                  params->dst.num_samples > 1 ?
                                  (1 << params->dst.num_samples) - 1 : 1);
    gen6_blorp_emit_state_base_address(brw, params);
-   gen6_blorp_emit_vertices(brw, params);
+   params->gen6_emit_vertices(brw);
    gen6_blorp_emit_urb_config(brw, params);
    if (params->use_wm_prog) {
       cc_blend_state_offset = gen6_blorp_emit_blend_state(brw, params);
diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
index 4c07820..feb31d5 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
@@ -823,7 +823,7 @@ gen7_blorp_exec(struct brw_context *brw,
                                  params->dst.num_samples > 1 ?
                                  (1 << params->dst.num_samples) - 1 : 1);
    gen6_blorp_emit_state_base_address(brw, params);
-   gen6_blorp_emit_vertices(brw, params);
+   params->gen6_emit_vertices(brw);
    gen7_blorp_emit_urb_config(brw);
    if (params->use_wm_prog) {
       cc_blend_state_offset = gen6_blorp_emit_blend_state(brw, params);
-- 
1.9.3



More information about the mesa-dev mailing list