[Mesa-dev] [PATCH 06/32] swr: [rasterizer archrast] Add additional API events

Tim Rowley timothy.o.rowley at intel.com
Thu Mar 16 19:09:31 UTC 2017


---
 .../drivers/swr/rasterizer/archrast/events.proto   | 36 ++++++++++++++++++++++
 src/gallium/drivers/swr/rasterizer/core/api.cpp    | 12 ++++++++
 2 files changed, 48 insertions(+)

diff --git a/src/gallium/drivers/swr/rasterizer/archrast/events.proto b/src/gallium/drivers/swr/rasterizer/archrast/events.proto
index 95cb79b..1afad3b 100644
--- a/src/gallium/drivers/swr/rasterizer/archrast/events.proto
+++ b/src/gallium/drivers/swr/rasterizer/archrast/events.proto
@@ -140,6 +140,42 @@ event FrameEndEvent
     uint32_t nextDrawId;
 };
 
+///@brief API Stat: Split draw event for DrawInstanced. In certain cases, Rasty can split draws up into smaller draws.
+event DrawInstancedSplitEvent
+{
+    uint32_t drawId;
+};
+
+///@brief API Stat: Split draw event for DrawIndexedInstanced.
+event DrawIndexedInstancedSplitEvent
+{
+    uint32_t drawId;
+};
+
+///@brief API Stat: Synchonization event.
+event SwrSyncEvent
+{
+    uint32_t drawId;
+};
+
+///@brief API Stat: Invalidate hot tiles (i.e. tile cache)
+event SwrInvalidateTilesEvent
+{
+    uint32_t drawId;
+};
+
+///@brief API Stat: Invalidate and discard hot tiles within pixel region
+event SwrDiscardRectEvent
+{
+    uint32_t drawId;
+};
+
+///@brief API Stat: Flush tiles out to memory that is typically owned by driver (e.g. Flush RT cache)
+event SwrStoreTilesEvent
+{
+    uint32_t drawId;
+};
+
 event FrontendStatsEvent
 {
     uint32_t drawId;
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp
index b99df2d..90503ba 100644
--- a/src/gallium/drivers/swr/rasterizer/core/api.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp
@@ -455,6 +455,8 @@ void SwrSync(HANDLE hContext, PFN_CALLBACK_FUNC pfnFunc, uint64_t userData, uint
     pDC->retireCallback.userData2 = userData2;
     pDC->retireCallback.userData3 = userData3;
 
+    AR_API_EVENT(SwrSyncEvent(pDC->drawId));
+
     //enqueue
     QueueDraw(pContext);
 
@@ -1138,6 +1140,8 @@ void DrawInstanced(
         //enqueue DC
         QueueDraw(pContext);
 
+        AR_API_EVENT(DrawInstancedSplitEvent(pDC->drawId));
+
         remainingVerts -= numVertsForDraw;
         draw++;
     }
@@ -1283,6 +1287,8 @@ void DrawIndexedInstance(
         //enqueue DC
         QueueDraw(pContext);
 
+        AR_API_EVENT(DrawIndexedInstancedSplitEvent(pDC->drawId));
+
         pIB += maxIndicesPerDraw * indexSize;
         remainingIndices -= numIndicesForDraw;
         draw++;
@@ -1366,6 +1372,8 @@ void SWR_API SwrInvalidateTiles(
 
     //enqueue
     QueueDraw(pContext);
+
+    AR_API_EVENT(SwrInvalidateTilesEvent(pDC->drawId));
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -1399,6 +1407,8 @@ void SWR_API SwrDiscardRect(
 
     //enqueue
     QueueDraw(pContext);
+
+    AR_API_EVENT(SwrDiscardRectEvent(pDC->drawId));
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -1468,6 +1478,8 @@ void SWR_API SwrStoreTiles(
     //enqueue
     QueueDraw(pContext);
 
+    AR_API_EVENT(SwrStoreTilesEvent(pDC->drawId));
+
     AR_API_END(APIStoreTiles, 1);
 }
 
-- 
2.7.4



More information about the mesa-dev mailing list