Mesa (master): swr/rast: Add KNOB_DISABLE_SPLIT_DRAW

George Kyriazis gkyriazis at kemper.freedesktop.org
Fri Mar 9 15:46:37 UTC 2018


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

Author: George Kyriazis <george.kyriazis at intel.com>
Date:   Tue Feb 27 15:29:52 2018 -0600

swr/rast: Add KNOB_DISABLE_SPLIT_DRAW

This is useful for archrast data collection. This greatly speeds up the
post processing script since there is significantly less events generated.

Finally, this is a simpler option to communicate to users than having
them directly adjust MAX_PRIMS_PER_DRAW and MAX_TESS_PRIMS_PER_DRAW.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>

---

 .../drivers/swr/rasterizer/codegen/knob_defs.py    | 10 +++++++++
 src/gallium/drivers/swr/rasterizer/core/api.cpp    | 24 ++++++++++++++--------
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/codegen/knob_defs.py b/src/gallium/drivers/swr/rasterizer/codegen/knob_defs.py
index 2c6946b063..d4bf1930a0 100644
--- a/src/gallium/drivers/swr/rasterizer/codegen/knob_defs.py
+++ b/src/gallium/drivers/swr/rasterizer/codegen/knob_defs.py
@@ -270,4 +270,14 @@ KNOBS = [
         'category'  : 'perf_adv',
     }],
     
+    ['DISABLE_SPLIT_DRAW', {
+        'type'      : 'bool',
+        'default'   : 'false',
+        'desc'      : ['Don\'t split large draws into smaller draws.,',
+                       'MAX_PRIMS_PER_DRAW and MAX_TESS_PRIMS_PER_DRAW can be used to control split size.',
+                       '',
+                       'Useful to disable split draws for gathering archrast stats.'],
+        'category'  : 'perf_adv',
+    }],
+
     ]
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp
index b2529598bd..53bd2d2855 100644
--- a/src/gallium/drivers/swr/rasterizer/core/api.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp
@@ -1077,13 +1077,27 @@ uint32_t MaxVertsPerDraw(
 {
     API_STATE& state = pDC->pState->state;
 
-    uint32_t vertsPerDraw = totalVerts;
-
+    // We can not split draws that have streamout enabled because there is no practical way
+    // to support multiple threads generating SO data for a single set of buffers.
     if (state.soState.soEnable)
     {
         return totalVerts;
     }
 
+    // The Primitive Assembly code can only handle 1 RECT at a time. Specified with only 3 verts.
+    if (topology == TOP_RECT_LIST)
+    {
+        return 3;
+    }
+
+    // Is split drawing disabled?
+    if (KNOB_DISABLE_SPLIT_DRAW)
+    {
+        return totalVerts;
+    }
+
+    uint32_t vertsPerDraw = totalVerts;
+
     switch (topology)
     {
     case TOP_POINT_LIST:
@@ -1129,12 +1143,6 @@ uint32_t MaxVertsPerDraw(
             vertsPerDraw = vertsPerPrim * KNOB_MAX_TESS_PRIMS_PER_DRAW;
         }
         break;
-
-    // The Primitive Assembly code can only handle 1 RECT at a time.
-    case TOP_RECT_LIST:
-        vertsPerDraw = 3;
-        break;
-
     default:
         // We are not splitting up draws for other topologies.
         break;




More information about the mesa-commit mailing list