Mesa (master): intel/blorp: Add helper function for stencil buffer resolve

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 29 21:50:35 UTC 2019


Module: Mesa
Branch: master
Commit: 53d472df24d4bc05359120df0615321318922d6d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=53d472df24d4bc05359120df0615321318922d6d

Author: Sagar Ghuge <sagar.ghuge at intel.com>
Date:   Tue Oct 15 11:15:22 2019 -0700

intel/blorp: Add helper function for stencil buffer resolve

On Gen12+, Stencil buffer's lossless compression should be resolved
with WM_HZ_OP packet.

Signed-off-by: Sagar Ghuge <sagar.ghuge at intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>

---

 src/intel/blorp/blorp.c | 30 ++++++++++++++++++++++++++++++
 src/intel/blorp/blorp.h |  4 ++++
 2 files changed, 34 insertions(+)

diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c
index 086bfb1c596..f93662ccae8 100644
--- a/src/intel/blorp/blorp.c
+++ b/src/intel/blorp/blorp.c
@@ -366,3 +366,33 @@ blorp_hiz_op(struct blorp_batch *batch, struct blorp_surf *surf,
       batch->blorp->exec(batch, &params);
    }
 }
+
+void
+blorp_hiz_stencil_op(struct blorp_batch *batch, struct blorp_surf *stencil,
+                     uint32_t level, uint32_t start_layer,
+                     uint32_t num_layers, enum isl_aux_op op)
+{
+   struct blorp_params params;
+   blorp_params_init(&params);
+
+   params.hiz_op = op;
+   params.full_surface_hiz_op = true;
+
+   for (uint32_t a = 0; a < num_layers; a++) {
+      const uint32_t layer = start_layer + a;
+
+         brw_blorp_surface_info_init(batch->blorp, &params.stencil, stencil, level,
+                                     layer, stencil->surf->format, true);
+         params.x1 = minify(params.stencil.surf.logical_level0_px.width,
+                            params.stencil.view.base_level);
+         params.y1 = minify(params.stencil.surf.logical_level0_px.height,
+                            params.stencil.view.base_level);
+         params.dst.surf.samples = params.stencil.surf.samples;
+         params.dst.surf.logical_level0_px =
+            params.stencil.surf.logical_level0_px;
+         params.dst.view = params.stencil.view;
+         params.num_samples = params.stencil.surf.samples;
+
+         batch->blorp->exec(batch, &params);
+   }
+}
diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h
index ead261b6230..afee0a96a8c 100644
--- a/src/intel/blorp/blorp.h
+++ b/src/intel/blorp/blorp.h
@@ -246,6 +246,10 @@ blorp_hiz_op(struct blorp_batch *batch, struct blorp_surf *surf,
              uint32_t level, uint32_t start_layer, uint32_t num_layers,
              enum isl_aux_op op);
 
+void
+blorp_hiz_stencil_op(struct blorp_batch *batch, struct blorp_surf *stencil,
+                     uint32_t level, uint32_t start_layer,
+                     uint32_t num_layers, enum isl_aux_op op);
 #ifdef __cplusplus
 } /* end extern "C" */
 #endif /* __cplusplus */




More information about the mesa-commit mailing list