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

Author: Nanley Chery <nanley.g.ch...@intel.com>
Date:   Thu Apr 26 17:09:29 2018 -0700

intel/blorp: Add a NO_UPDATE_CLEAR_COLOR batch flag

Allow callers to handle updating the indirect clear color buffer
themselves. This can reduce the number of clear color updates in the
case where a caller performs multiple fast clears with the same clear
color.

Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net>

---

 src/intel/blorp/blorp.h           | 5 +++++
 src/intel/blorp/blorp_genX_exec.h | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h
index 4626f2f83c..f22110bc84 100644
--- a/src/intel/blorp/blorp.h
+++ b/src/intel/blorp/blorp.h
@@ -72,6 +72,11 @@ enum blorp_batch_flags {
 
    /* This flag indicates that the blorp call should be predicated. */
    BLORP_BATCH_PREDICATE_ENABLE      = (1 << 1),
+
+   /* This flag indicates that blorp should *not* update the indirect clear
+    * color buffer.
+    */
+   BLORP_BATCH_NO_UPDATE_CLEAR_COLOR = (1 << 2),
 };
 
 struct blorp_batch {
diff --git a/src/intel/blorp/blorp_genX_exec.h 
b/src/intel/blorp/blorp_genX_exec.h
index 593521b95c..446743b591 100644
--- a/src/intel/blorp/blorp_genX_exec.h
+++ b/src/intel/blorp/blorp_genX_exec.h
@@ -1700,8 +1700,10 @@ blorp_update_clear_color(struct blorp_batch *batch,
 static void
 blorp_exec(struct blorp_batch *batch, const struct blorp_params *params)
 {
-   blorp_update_clear_color(batch, &params->dst, params->fast_clear_op);
-   blorp_update_clear_color(batch, &params->depth, params->hiz_op);
+   if (!(batch->flags & BLORP_BATCH_NO_UPDATE_CLEAR_COLOR)) {
+      blorp_update_clear_color(batch, &params->dst, params->fast_clear_op);
+      blorp_update_clear_color(batch, &params->depth, params->hiz_op);
+   }
 
 #if GEN_GEN >= 8
    if (params->hiz_op != ISL_AUX_OP_NONE) {

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to