aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2016-04-15 13:39:48 +0300
committerTopi Pohjolainen <[email protected]>2016-04-21 10:20:03 +0300
commit69dfb7b2b7f2686f782414bc303f24f584f8f850 (patch)
treeafc55859517ebfc98a773700c11471f7bf867121 /src/mesa
parent7644e8ab6814554420b01a900643ba72bb09b2c9 (diff)
i965/blorp: Skip re-emitting urb config whenever possible
Otherwise clearing with blorp will regress performance in some synthetic test cases. v2: Used vsize >= 2 instead of vsize > 0, and updated the comment. Review by Ken in one of the earlier patches revealed this. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/gen7_blorp.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
index 712291d1999..c6f95492de2 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
@@ -31,6 +31,18 @@
#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 elements along with full VUE header take 96 bytes. As the size
+ * is expressed in 64 bytes, one needs at least two times that, otherwise
+ * the setup can be any valid configuration.
+ */
+ return brw->urb.vsize >= 2;
+}
/* 3DSTATE_URB_VS
* 3DSTATE_URB_HS
@@ -59,6 +71,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 */,