swr/rast: Add split draw and other state information to DrawInfoEvent.
authorGeorge Kyriazis <george.kyriazis@intel.com>
Mon, 26 Feb 2018 23:55:23 +0000 (17:55 -0600)
committerGeorge Kyriazis <george.kyriazis@intel.com>
Fri, 9 Mar 2018 15:36:07 +0000 (09:36 -0600)
Removed specific split draw events.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp
src/gallium/drivers/swr/rasterizer/archrast/events.proto
src/gallium/drivers/swr/rasterizer/archrast/events_private.proto
src/gallium/drivers/swr/rasterizer/core/api.cpp

index d5cffbb5cec1604f7745b7828cee13f0c19e51c3..af18b161eaf0846ee4c4c3e93754c39f725338b4 100644 (file)
@@ -85,28 +85,18 @@ namespace ArchRast
 
         virtual void Handle(const DrawInstancedEvent& event)
         {
-            DrawInfoEvent e(event.data.drawId, ArchRast::Instanced, event.data.topology, event.data.numVertices, 0, 0, event.data.startVertex, event.data.numInstances, event.data.startInstance);
+            DrawInfoEvent e(event.data.drawId, ArchRast::Instanced, event.data.topology, 
+                event.data.numVertices, 0, 0, event.data.startVertex, event.data.numInstances, 
+                event.data.startInstance, event.data.tsEnable, event.data.gsEnable, event.data.soEnable, event.data.splitId);
 
             EventHandlerFile::Handle(e);
         }
 
         virtual void Handle(const DrawIndexedInstancedEvent& event)
         {
-            DrawInfoEvent e(event.data.drawId, ArchRast::IndexedInstanced, event.data.topology, 0, event.data.numIndices, event.data.indexOffset, event.data.baseVertex, event.data.numInstances, event.data.startInstance);
-
-            EventHandlerFile::Handle(e);
-        }
-
-        virtual void Handle(const DrawInstancedSplitEvent& event)
-        {
-            DrawInfoEvent e(event.data.drawId, ArchRast::InstancedSplit, 0, 0, 0, 0, 0, 0, 0);
-
-            EventHandlerFile::Handle(e);
-        }
-
-        virtual void Handle(const DrawIndexedInstancedSplitEvent& event)
-        {
-            DrawInfoEvent e(event.data.drawId, ArchRast::IndexedInstancedSplit, 0, 0, 0, 0, 0, 0, 0);
+            DrawInfoEvent e(event.data.drawId, ArchRast::IndexedInstanced, event.data.topology, 0,
+                event.data.numIndices, event.data.indexOffset, event.data.baseVertex, event.data.numInstances,
+                event.data.startInstance, event.data.tsEnable, event.data.gsEnable, event.data.soEnable, event.data.splitId);
 
             EventHandlerFile::Handle(e);
         }
index ee5d75b5f2feda8e80e9dcbde8e90a9a01aa4bd0..45193a33fd30eda8da258cb1ac7fc80f5b6bfcef 100644 (file)
@@ -48,6 +48,10 @@ event DrawInfoEvent
     int32_t  baseVertex;
     uint32_t numInstances;
     uint32_t startInstance;
+    uint32_t tsEnable;
+    uint32_t gsEnable;
+    uint32_t soEnable;
+    uint32_t splitId; // Split draw count or id.
 };
 
 event DispatchEvent
index a07c4a7f13646bae164fab04fec407e72e5d6796..760f7aa4957ecd77f5930df3914d20cf26b88327 100644 (file)
@@ -128,6 +128,10 @@ event DrawInstancedEvent
     int32_t  startVertex;
     uint32_t numInstances;
     uint32_t startInstance;
+    uint32_t tsEnable;
+    uint32_t gsEnable;
+    uint32_t soEnable;
+    uint32_t splitId; // Split draw count or id.
 };
 
 event DrawIndexedInstancedEvent
@@ -139,16 +143,8 @@ event DrawIndexedInstancedEvent
     int32_t  baseVertex;
     uint32_t numInstances;
     uint32_t startInstance;
-};
-
-///@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;
+    uint32_t tsEnable;
+    uint32_t gsEnable;
+    uint32_t soEnable;
+    uint32_t splitId; // Split draw count or id.
 };
index 99d3cd5bb0125821a8ffd4b457a4849445ad5a3a..86864f022aa295ff109239ec4212feda3db8000c 100644 (file)
@@ -1169,7 +1169,6 @@ void DrawInstanced(
     DRAW_CONTEXT* pDC = GetDrawContext(pContext);
 
     RDTSC_BEGIN(APIDraw, pDC->drawId);
-    AR_API_EVENT(DrawInstancedEvent(pDC->drawId, topology, numVertices, startVertex, numInstances, startInstance));
 
     uint32_t maxVertsPerDraw = MaxVertsPerDraw(pDC, numVertices, topology);
     uint32_t primsPerDraw = GetNumPrims(topology, maxVertsPerDraw);
@@ -1221,7 +1220,8 @@ void DrawInstanced(
         //enqueue DC
         QueueDraw(pContext);
 
-        AR_API_EVENT(DrawInstancedSplitEvent(pDC->drawId));
+        AR_API_EVENT(DrawInstancedEvent(pDC->drawId, topology, numVertsForDraw, startVertex, numInstances,
+            startInstance, pState->tsState.tsEnable, pState->gsState.gsEnable, pState->soState.soEnable, draw));
 
         remainingVerts -= numVertsForDraw;
         draw++;
@@ -1297,7 +1297,6 @@ void DrawIndexedInstance(
     API_STATE* pState = &pDC->pState->state;
 
     RDTSC_BEGIN(APIDrawIndexed, pDC->drawId);
-    AR_API_EVENT(DrawIndexedInstancedEvent(pDC->drawId, topology, numIndices, indexOffset, baseVertex, numInstances, startInstance));
 
     uint32_t maxIndicesPerDraw = MaxVertsPerDraw(pDC, numIndices, topology);
     uint32_t primsPerDraw = GetNumPrims(topology, maxIndicesPerDraw);
@@ -1366,7 +1365,8 @@ void DrawIndexedInstance(
         //enqueue DC
         QueueDraw(pContext);
 
-        AR_API_EVENT(DrawIndexedInstancedSplitEvent(pDC->drawId));
+        AR_API_EVENT(DrawIndexedInstancedEvent(pDC->drawId, topology, numIndicesForDraw, indexOffset, baseVertex,
+            numInstances, startInstance, pState->tsState.tsEnable, pState->gsState.gsEnable, pState->soState.soEnable, draw));
 
         pIB += maxIndicesPerDraw * indexSize;
         remainingIndices -= numIndicesForDraw;