mClipper.trivialAcceptCount += _mm_popcnt_u32(event.data.validMask & ~event.data.clipMask);
}
+ virtual void Handle(const DrawInstancedEvent& event)
+ {
+ DrawInfoEvent e(event.data.drawId, event.data.type, event.data.topology, event.data.numVertices, 0, 0, event.data.startVertex, event.data.numInstances, event.data.startInstance);
+
+ EventHandlerFile::Handle(e);
+ }
+
+ virtual void Handle(const DrawIndexedInstancedEvent& event)
+ {
+ DrawInfoEvent e(event.data.drawId, event.data.type, 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, event.data.type, 0, 0, 0, 0, 0, 0, 0);
+
+ EventHandlerFile::Handle(e);
+ }
+
+ virtual void Handle(const DrawIndexedInstancedSplitEvent& event)
+ {
+ DrawInfoEvent e(event.data.drawId, event.data.type, 0, 0, 0, 0, 0, 0, 0);
+
+ EventHandlerFile::Handle(e);
+ }
+
// Flush cached events for this draw
virtual void FlushDraw(uint32_t drawId)
{
#
# Provides definitions for events.
-event ThreadStartApiEvent
+enum AR_DRAW_TYPE
{
+ Instanced = 0,
+ IndexedInstanced = 1,
+ InstancedSplit = 2,
+ IndexedInstancedSplit = 3
};
-event ThreadStartWorkerEvent
+event ThreadStartApiEvent
{
};
-event DrawInstancedEvent
+event ThreadStartWorkerEvent
{
- uint32_t drawId;
- uint32_t topology;
- uint32_t numVertices;
- int32_t startVertex;
- uint32_t numInstances;
- uint32_t startInstance;
};
-event DrawIndexedInstancedEvent
+event DrawInfoEvent
{
uint32_t drawId;
+ AR_DRAW_TYPE type;
uint32_t topology;
+ uint32_t numVertices;
uint32_t numIndices;
int32_t indexOffset;
int32_t baseVertex;
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 validMask;
uint32_t clipMask;
};
+
+event DrawInstancedEvent
+{
+ uint32_t drawId;
+ AR_DRAW_TYPE type;
+ uint32_t topology;
+ uint32_t numVertices;
+ int32_t startVertex;
+ uint32_t numInstances;
+ uint32_t startInstance;
+};
+
+event DrawIndexedInstancedEvent
+{
+ uint32_t drawId;
+ AR_DRAW_TYPE type;
+ uint32_t topology;
+ uint32_t numIndices;
+ int32_t indexOffset;
+ 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;
+ AR_DRAW_TYPE type;
+};
+
+///@brief API Stat: Split draw event for DrawIndexedInstanced.
+event DrawIndexedInstancedSplitEvent
+{
+ uint32_t drawId;
+ AR_DRAW_TYPE type;
+};
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
RDTSC_BEGIN(APIDraw, pDC->drawId);
- AR_API_EVENT(DrawInstancedEvent(pDC->drawId, topology, numVertices, startVertex, numInstances, startInstance));
+ AR_API_EVENT(DrawInstancedEvent(pDC->drawId, ArchRast::Instanced, topology, numVertices, startVertex, numInstances, startInstance));
uint32_t maxVertsPerDraw = MaxVertsPerDraw(pDC, numVertices, topology);
uint32_t primsPerDraw = GetNumPrims(topology, maxVertsPerDraw);
//enqueue DC
QueueDraw(pContext);
- AR_API_EVENT(DrawInstancedSplitEvent(pDC->drawId));
+ AR_API_EVENT(DrawInstancedSplitEvent(pDC->drawId, ArchRast::InstancedSplit));
remainingVerts -= numVertsForDraw;
draw++;
API_STATE* pState = &pDC->pState->state;
RDTSC_BEGIN(APIDrawIndexed, pDC->drawId);
- AR_API_EVENT(DrawIndexedInstancedEvent(pDC->drawId, topology, numIndices, indexOffset, baseVertex, numInstances, startInstance));
+ AR_API_EVENT(DrawIndexedInstancedEvent(pDC->drawId, ArchRast::IndexedInstancedSplit, topology, numIndices, indexOffset, baseVertex, numInstances, startInstance));
uint32_t maxIndicesPerDraw = MaxVertsPerDraw(pDC, numIndices, topology);
uint32_t primsPerDraw = GetNumPrims(topology, maxIndicesPerDraw);
//enqueue DC
QueueDraw(pContext);
- AR_API_EVENT(DrawIndexedInstancedSplitEvent(pDC->drawId));
+ AR_API_EVENT(DrawIndexedInstancedSplitEvent(pDC->drawId, ArchRast::IndexedInstancedSplit));
pIB += maxIndicesPerDraw * indexSize;
remainingIndices -= numIndicesForDraw;