[Mesa-dev] [PATCH 14/16] i965/blorp/gen7: Move surface setup for the parameter type to handle

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


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

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h
index d07d3c0..238a966 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp.h
@@ -218,6 +218,7 @@ public:
    virtual void gen6_emit_wm_constants(struct brw_context *brw);
 
    virtual void gen6_emit_surface_states(struct brw_context *brw);
+   virtual void gen7_emit_surface_states(struct brw_context *brw);
 
    virtual void gen6_emit_wm_config(struct brw_context *brw) const;
    virtual void gen7_emit_wm_config(struct brw_context *brw) const;
@@ -362,6 +363,7 @@ public:
    virtual void gen6_emit_wm_constants(struct brw_context *brw);
 
    virtual void gen6_emit_surface_states(struct brw_context *brw);
+   virtual void gen7_emit_surface_states(struct brw_context *brw);
 
    virtual void gen6_emit_wm_config(struct brw_context *brw) const;
    virtual void gen7_emit_wm_config(struct brw_context *brw) const;
@@ -379,6 +381,7 @@ private:
    uint32_t prog_offset;
    uint32_t wm_push_const_offset;
    uint32_t wm_bind_bo_offset;
+   uint32_t sampler_offset;
 };
 
 /**
diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
index ce4e46d..4c07820 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
@@ -755,6 +755,11 @@ brw_blorp_params::gen7_emit_wm_config(struct brw_context *brw) const
 }
 
 void
+brw_blorp_params::gen7_emit_surface_states(struct brw_context *brw)
+{
+}
+
+void
 brw_blorp_params::gen7_emit_ps_config(struct brw_context *brw) const
 {
    gen7_blorp_emit_constant_ps_disable(brw);
@@ -765,6 +770,31 @@ void
 brw_blorp_blit_params::gen7_emit_wm_config(struct brw_context *brw) const
 {
    gen7_blorp_emit_wm_config(brw, this, prog_data);
+   gen7_blorp_emit_binding_table_pointers_ps(brw, wm_bind_bo_offset);
+}
+
+void
+brw_blorp_blit_params::gen7_emit_surface_states(struct brw_context *brw)
+{
+   uint32_t wm_surf_offset_renderbuffer;
+   uint32_t wm_surf_offset_texture = 0;
+   intel_miptree_used_for_rendering(dst.mt);
+   wm_surf_offset_renderbuffer =
+      gen7_blorp_emit_surface_state(brw, &dst,
+                                    I915_GEM_DOMAIN_RENDER,
+                                    I915_GEM_DOMAIN_RENDER,
+                                    true /* is_render_target */);
+   if (src.mt) {
+      wm_surf_offset_texture =
+         gen7_blorp_emit_surface_state(brw, &src,
+                                       I915_GEM_DOMAIN_SAMPLER, 0,
+                                       false /* is_render_target */);
+   }
+
+   wm_bind_bo_offset =
+      gen6_blorp_emit_binding_table(brw,
+                                    wm_surf_offset_renderbuffer,
+                                    wm_surf_offset_texture);
 }
 
 void
@@ -787,7 +817,6 @@ gen7_blorp_exec(struct brw_context *brw,
    uint32_t cc_blend_state_offset = 0;
    uint32_t cc_state_offset = 0;
    uint32_t depthstencil_offset;
-   uint32_t wm_bind_bo_offset = 0;
 
    gen6_emit_3dstate_multisample(brw, params->dst.num_samples);
    gen6_emit_3dstate_sample_mask(brw,
@@ -805,26 +834,7 @@ gen7_blorp_exec(struct brw_context *brw,
    depthstencil_offset = gen6_blorp_emit_depth_stencil_state(brw, params);
    gen7_blorp_emit_depth_stencil_state_pointers(brw, depthstencil_offset);
    params->gen6_emit_wm_constants(brw);
-   if (params->use_wm_prog) {
-      uint32_t wm_surf_offset_renderbuffer;
-      uint32_t wm_surf_offset_texture = 0;
-      intel_miptree_used_for_rendering(params->dst.mt);
-      wm_surf_offset_renderbuffer =
-         gen7_blorp_emit_surface_state(brw, &params->dst,
-                                       I915_GEM_DOMAIN_RENDER,
-                                       I915_GEM_DOMAIN_RENDER,
-                                       true /* is_render_target */);
-      if (params->src.mt) {
-         wm_surf_offset_texture =
-            gen7_blorp_emit_surface_state(brw, &params->src,
-                                          I915_GEM_DOMAIN_SAMPLER, 0,
-                                          false /* is_render_target */);
-      }
-      wm_bind_bo_offset =
-         gen6_blorp_emit_binding_table(brw,
-                                       wm_surf_offset_renderbuffer,
-                                       wm_surf_offset_texture);
-   }
+   params->gen7_emit_surface_states(brw);
    params->gen6_emit_sampler_state(brw);
    gen7_blorp_emit_vs_disable(brw);
    gen7_blorp_emit_hs_disable(brw);
@@ -835,9 +845,6 @@ gen7_blorp_exec(struct brw_context *brw,
    gen6_blorp_emit_clip_disable(brw);
    gen7_blorp_emit_sf_config(brw, params);
    params->gen7_emit_wm_config(brw);
-   if (params->use_wm_prog) {
-      gen7_blorp_emit_binding_table_pointers_ps(brw, wm_bind_bo_offset);
-   }
    params->gen7_emit_ps_config(brw);
    gen7_blorp_emit_cc_viewport(brw);
 
-- 
1.9.3



More information about the mesa-dev mailing list