[Mesa-dev] [PATCH 34/40] i965/blorp: Skip re-emitting urb config whenever possible

Topi Pohjolainen topi.pohjolainen at intel.com
Sat Apr 16 13:43:02 UTC 2016


Otherwise clearing with blorp will regress performance in some
synthetic test cases.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/gen7_blorp.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
index b85a6a5..87920c7 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
@@ -31,6 +31,17 @@
 
 #include "brw_blorp.h"
 
+static bool
+gen7_blorp_skip_urb_config(const struct brw_context *brw)
+{
+   if (brw->ctx.NewDriverState & (BRW_NEW_CONTEXT | BRW_NEW_URB_SIZE))
+      return false;
+
+   /* Vertex state urb size can't be zero, otherwise the setup can be
+    * any valid configuration.
+    */
+   return brw->urb.vsize > 0;
+}
 
 /* 3DSTATE_URB_VS
  * 3DSTATE_URB_HS
@@ -59,6 +70,9 @@ gen7_blorp_emit_urb_config(struct brw_context *brw)
    const unsigned vs_chunks =
       DIV_ROUND_UP(brw->urb.min_vs_entries * vs_size * 64, chunk_size_bytes);
 
+   if (gen7_blorp_skip_urb_config(brw))
+      return;
+
    gen7_emit_push_constant_state(brw,
                                  urb_size / 2 /* vs_size */,
                                  0 /* hs_size */,
-- 
2.5.5



More information about the mesa-dev mailing list