swr: [rasterizer archrast] fix event file issue with saving data
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 11 Oct 2016 17:42:35 +0000 (12:42 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Fri, 14 Oct 2016 04:39:13 +0000 (23:39 -0500)
Also, tagging stats with draw id to correlate these events with
draw/dispatch events.

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/rasterizer/archrast/events.proto
src/gallium/drivers/swr/rasterizer/core/threads.cpp
src/gallium/drivers/swr/rasterizer/scripts/templates/ar_event_h.template
src/gallium/drivers/swr/rasterizer/scripts/templates/ar_eventhandlerfile_h.template

index 6dccad61c459c246bb50c025a268a0c312f1f500..4ddb7c988c046ff00b90c421c9a9aacb07c30ccb 100644 (file)
@@ -99,7 +99,7 @@ event End
 
 event DrawInstancedEvent
 {
-    uint32_t id;
+    uint32_t drawId;
     uint32_t topology;
     uint32_t numVertices;
     int32_t  startVertex;
@@ -109,7 +109,7 @@ event DrawInstancedEvent
 
 event DrawIndexedInstancedEvent
 {
-    uint32_t id;
+    uint32_t drawId;
     uint32_t topology;
     uint32_t numIndices;
     int32_t  indexOffset;
@@ -120,7 +120,7 @@ event DrawIndexedInstancedEvent
 
 event DispatchEvent
 {
-    uint32_t id;
+    uint32_t drawId;
     uint32_t threadGroupCountX;
     uint32_t threadGroupCountY;
     uint32_t threadGroupCountZ;
@@ -134,6 +134,7 @@ event FrameEndEvent
 
 event FrontendStatsEvent
 {
+    uint32_t drawId;
     uint64_t IaVertices;
     uint64_t IaPrimitives;
     uint64_t VsInvocations;
@@ -155,6 +156,7 @@ event FrontendStatsEvent
 
 event BackendStatsEvent
 {
+    uint32_t drawId;
     uint64_t DepthPassCount;
     uint64_t PsInvocations;
     uint64_t CsInvocations;
index 6e7495cdc50f14908d4b3542075f5ed58c869286..a8864c7d7bc353fa8075c33a28e498d59b059431 100644 (file)
@@ -570,7 +570,7 @@ INLINE void CompleteDrawFE(SWR_CONTEXT* pContext, uint32_t workerId, DRAW_CONTEX
     {
         SWR_STATS_FE& stats = pDC->dynState.statsFE;
 
-        AR_EVENT(FrontendStatsEvent(
+        AR_EVENT(FrontendStatsEvent(pDC->drawId,
             stats.IaVertices, stats.IaPrimitives, stats.VsInvocations, stats.HsInvocations,
             stats.DsInvocations, stats.GsInvocations, stats.GsPrimitives, stats.CInvocations, stats.CPrimitives,
             stats.SoPrimStorageNeeded[0], stats.SoPrimStorageNeeded[1], stats.SoPrimStorageNeeded[2], stats.SoPrimStorageNeeded[3],
index c1576f7b3176077e7aaee3ce5003496a03c425cb..e5c94c7a8d6bb0427a92dd94b551426e9259d3e3 100644 (file)
@@ -56,9 +56,10 @@ namespace ArchRast
 % for name in protos['event_names']:
 
     //////////////////////////////////////////////////////////////////////////
-    /// ${name}
+    /// ${name}Data
     //////////////////////////////////////////////////////////////////////////
-    struct ${name} : Event
+#pragma pack(push, 1)
+    struct ${name}Data
     {<%
         field_names = protos['events'][name]['field_names']
         field_types = protos['events'][name]['field_types'] %>
@@ -66,6 +67,17 @@ namespace ArchRast
         % for i in range(len(field_names)):
         ${field_types[i]} ${field_names[i]};
         % endfor
+    };
+#pragma pack(pop)
+
+    //////////////////////////////////////////////////////////////////////////
+    /// ${name}
+    //////////////////////////////////////////////////////////////////////////
+    struct ${name} : Event
+    {<%
+        field_names = protos['events'][name]['field_names']
+        field_types = protos['events'][name]['field_types'] %>
+        ${name}Data data;
 
         // Constructor
         ${name}(
@@ -79,7 +91,7 @@ namespace ArchRast
         % endfor
         {
         % for i in range(len(field_names)):
-            this->${field_names[i]} = ${field_names[i]};
+            data.${field_names[i]} = ${field_names[i]};
         % endfor
         }
 
index 2e3b5c32464d75c8ef89177a0177189593e3272d..1924b15ca325527ea3beb24c172d68311c7325ef 100644 (file)
@@ -83,7 +83,7 @@ namespace ArchRast
 % for name in protos['event_names']:
         virtual void handle(${name}& event)
         {
-            write(${protos['events'][name]['event_id']}, (char*)&event, sizeof(event));
+            write(${protos['events'][name]['event_id']}, (char*)&event.data, sizeof(event.data));
         }
 % endfor