swr: [rasterizer archrast] fix event file issue with saving data

Also, tagging stats with draw id to correlate these events with
draw/dispatch events.

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
This commit is contained in:
Tim Rowley 2016-10-11 12:42:35 -05:00
parent 827e038062
commit bf1f46216c
4 changed files with 22 additions and 8 deletions

View 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;

View 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],

View 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
}

View 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