[Mesa-dev] [PATCH] gallium/u_threaded: increase batch size to increase performance

Marek Olšák maraeo at gmail.com
Sat Sep 1 07:14:38 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

This reduces mutex overhead.

+4.4% performance with piglit/drawoverhead, DrawElements, Ryzen X1700
---
 src/gallium/auxiliary/util/u_threaded_context.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h
index 53c5a7e8c4c..be6933d05a4 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.h
+++ b/src/gallium/auxiliary/util/u_threaded_context.h
@@ -213,21 +213,21 @@ struct tc_unflushed_batch_token;
  * slots.
  */
 #define TC_MAX_BATCHES        10
 
 /* The size of one batch. Non-trivial calls (i.e. not setting a CSO pointer)
  * can occupy multiple call slots.
  *
  * The idea is to have batches as small as possible but large enough so that
  * the queuing and mutex overhead is negligible.
  */
-#define TC_CALLS_PER_BATCH    192
+#define TC_CALLS_PER_BATCH    768
 
 /* Threshold for when to use the queue or sync. */
 #define TC_MAX_STRING_MARKER_BYTES  512
 
 /* Threshold for when to enqueue buffer/texture_subdata as-is.
  * If the upload size is greater than this, it will do instead:
  * - for buffers: DISCARD_RANGE is done by the threaded context
  * - for textures: sync and call the driver directly
  */
 #define TC_MAX_SUBDATA_BYTES        320
-- 
2.17.1



More information about the mesa-dev mailing list