<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 27, 2017 at 11:32 AM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
---<br>
 src/intel/blorp/blorp.h       |  9 ++++++<br>
 src/intel/blorp/blorp_clear.c | 64 ++++++++++++++++++++++++++++++<wbr>++-----------<br>
 2 files changed, 57 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h<br>
index eab75d70ab..8b8227bb1c 100644<br>
--- a/src/intel/blorp/blorp.h<br>
+++ b/src/intel/blorp/blorp.h<br>
@@ -191,6 +191,15 @@ blorp_ccs_resolve(struct blorp_batch *batch,<br>
                   enum isl_format format,<br>
                   enum blorp_fast_clear_op resolve_op);<br>
<br>
+/* Resolves the image subresource specified in the binding table.  */<br>
+void<br>
+blorp_ccs_resolve_bt(struct blorp_batch *batch,<br>
+                     const uint32_t binding_table_offset,<br>
+                     struct blorp_surf * const surf,<br>
+                     const uint32_t level, const uint32_t layer,<br>
+                     const enum isl_format format,<br>
+                     const enum blorp_fast_clear_op resolve_op);<br></blockquote><div><br></div><div>Other binding-table versions of functions in blorp use the _attachment suffix instead of _bt.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
 /**<br>
  * For an overview of the HiZ operations, see the following sections of the<br>
  * Sandy Bridge PRM, Volume 1, Part2:<br>
diff --git a/src/intel/blorp/blorp_clear.<wbr>c b/src/intel/blorp/blorp_clear.<wbr>c<br>
index 4e834ba123..6204784a7e 100644<br>
--- a/src/intel/blorp/blorp_clear.<wbr>c<br>
+++ b/src/intel/blorp/blorp_clear.<wbr>c<br>
@@ -665,20 +665,20 @@ blorp_clear_attachments(struct blorp_batch *batch,<br>
    batch->blorp->exec(batch, &params);<br>
 }<br>
<br>
-void<br>
-blorp_ccs_resolve(struct blorp_batch *batch,<br>
-                  struct blorp_surf *surf, uint32_t level, uint32_t layer,<br>
-                  enum isl_format format,<br>
-                  enum blorp_fast_clear_op resolve_op)<br>
+static void<br>
+blorp_ccs_resolve_prepare(<wbr>struct blorp_batch * const batch,<br>
+                          struct blorp_params * const params,<br>
+                          const struct blorp_surf * const surf,<br>
+                          const uint32_t level, const uint32_t layer,<br>
+                          const enum isl_format format,<br>
+                          const enum blorp_fast_clear_op resolve_op)<br></blockquote><div><br></div><div>Maybe call this prepare_ccs_resolve?  Or maybe blorp_params_init_for_ccs_resolve and do the init in here too?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 {<br>
-   struct blorp_params params;<br>
-   blorp_params_init(&params);<br>
<br>
    /* Layered and mipmapped fast clear is only available from Gen8 onwards. */<br>
    assert(ISL_DEV_GEN(batch-><wbr>blorp->isl_dev) >= 8 ||<br>
           (level == 0 && layer == 0));<br>
<br>
-   brw_blorp_surface_info_init(<wbr>batch->blorp, &params.dst, surf,<br>
+   brw_blorp_surface_info_init(<wbr>batch->blorp, &params->dst, surf,<br>
                                level, layer, format, true);<br>
<br>
    /* From the Ivy Bridge PRM, Vol2 Part1 11.9 "Render Target Resolve":<br>
@@ -691,7 +691,7 @@ blorp_ccs_resolve(struct blorp_batch *batch,<br>
     * multiply by 8 and 16. On Sky Lake, we multiply by 8.<br>
     */<br>
    const struct isl_format_layout *aux_fmtl =<br>
-      isl_format_get_layout(params.<wbr>dst.aux_surf.format);<br>
+      isl_format_get_layout(params-><wbr>dst.aux_surf.format);<br>
    assert(aux_fmtl->txc == ISL_TXC_CCS);<br>
<br>
    unsigned x_scaledown, y_scaledown;<br>
@@ -705,11 +705,11 @@ blorp_ccs_resolve(struct blorp_batch *batch,<br>
       x_scaledown = aux_fmtl->bw / 2;<br>
       y_scaledown = aux_fmtl->bh / 2;<br>
    }<br>
-   params.x0 = params.y0 = 0;<br>
-   params.x1 = minify(params.dst.aux_surf.<wbr>logical_level0_px.width, level);<br>
-   params.y1 = minify(params.dst.aux_surf.<wbr>logical_level0_px.height, level);<br>
-   params.x1 = ALIGN(params.x1, x_scaledown) / x_scaledown;<br>
-   params.y1 = ALIGN(params.y1, y_scaledown) / y_scaledown;<br>
+   params->x0 = params->y0 = 0;<br>
+   params->x1 = minify(params->dst.aux_surf.<wbr>logical_level0_px.width, level);<br>
+   params->y1 = minify(params->dst.aux_surf.<wbr>logical_level0_px.height, level);<br>
+   params->x1 = ALIGN(params->x1, x_scaledown) / x_scaledown;<br>
+   params->y1 = ALIGN(params->y1, y_scaledown) / y_scaledown;<br>
<br>
    if (batch->blorp->isl_dev->info-><wbr>gen >= 9) {<br>
       assert(resolve_op == BLORP_FAST_CLEAR_OP_RESOLVE_<wbr>FULL ||<br>
@@ -718,7 +718,7 @@ blorp_ccs_resolve(struct blorp_batch *batch,<br>
       /* Broadwell and earlier do not have a partial resolve */<br>
       assert(resolve_op == BLORP_FAST_CLEAR_OP_RESOLVE_<wbr>FULL);<br>
    }<br>
-   params.fast_clear_op = resolve_op;<br>
+   params->fast_clear_op = resolve_op;<br>
<br>
    /* Note: there is no need to initialize push constants because it doesn't<br>
     * matter what data gets dispatched to the render target.  However, we must<br>
@@ -726,8 +726,40 @@ blorp_ccs_resolve(struct blorp_batch *batch,<br>
     * color" message.<br>
     */<br>
<br>
-   if (!blorp_params_get_clear_<wbr>kernel(batch->blorp, &params, true))<br>
+   if (!blorp_params_get_clear_<wbr>kernel(batch->blorp, params, true))<br>
       return;<br>
+}<br>
+<br>
+void<br>
+blorp_ccs_resolve(struct blorp_batch *batch,<br>
+                  struct blorp_surf *surf, uint32_t level, uint32_t layer,<br>
+                  enum isl_format format,<br>
+                  enum blorp_fast_clear_op resolve_op)<br>
+{<br>
+   struct blorp_params params;<br>
+   blorp_params_init(&params);<br></blockquote><div><br></div><div>I think you can do the init in the prepare function as well.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+   blorp_ccs_resolve_prepare(<wbr>batch, &params, surf, level, layer, format,<br>
+                             resolve_op);<br>
+<br>
+   batch->blorp->exec(batch, &params);<br>
+}<br>
+<br>
+void<br>
+blorp_ccs_resolve_bt(struct blorp_batch *batch,<br>
+                     const uint32_t binding_table_offset,<br>
+                     struct blorp_surf * const surf,<br>
+                     const uint32_t level, const uint32_t layer,<br>
+                     const enum isl_format format,<br>
+                     const enum blorp_fast_clear_op resolve_op)<br>
+{<br>
+   struct blorp_params params;<br>
+   blorp_params_init(&params);<br>
+<br>
+   params.use_pre_baked_binding_<wbr>table = true;<br>
+   params.pre_baked_binding_<wbr>table_offset = binding_table_offset;<br>
<br>
+   blorp_ccs_resolve_prepare(<wbr>batch, &params, surf, level, layer, format,<br>
+                             resolve_op);<br>
    batch->blorp->exec(batch, &params);<br>
 }<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.2<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>