return pDC->pState->pArena->AllocAligned(size, align);
}
-//////////////////////////////////////////////////////////////////////////
-/// @brief Returns pointer to SWR stats.
-/// @note The counters are atomically incremented by multiple threads.
-/// When calling this, you need to ensure all previous operations
-/// have completed.
-/// @todo If necessary, add a callback to avoid stalling the pipe to
-/// sample the counters.
-/// @param hContext - Handle passed back from SwrCreateContext
-/// @param pStats - SWR will fill this out for caller.
-void SwrGetStats(
- HANDLE hContext,
- SWR_STATS* pStats)
-{
- SWR_ASSERT(0);
-}
-
//////////////////////////////////////////////////////////////////////////
/// @brief Enables stats counting
/// @param hContext - Handle passed back from SwrCreateContext
uint32_t size,
uint32_t align);
-//////////////////////////////////////////////////////////////////////////
-/// @brief Returns pointer to SWR stats.
-/// @note The counters are incremented by multiple threads.
-/// When calling this, you need to ensure all previous operations
-/// have completed.
-/// @param hContext - Handle passed back from SwrCreateContext
-/// @param pStats - SWR will fill this out for caller.
-void SWR_API SwrGetStats(
- HANDLE hContext,
- SWR_STATS* pStats);
-
//////////////////////////////////////////////////////////////////////////
/// @brief Enables stats counting
/// @param hContext - Handle passed back from SwrCreateContext
SWR_ASSERT(x == 0 && y == 0);
}
-void ProcessQueryStatsBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pUserData)
-{
- QUERY_DESC* pQueryDesc = (QUERY_DESC*)pUserData;
- SWR_STATS* pStats = pQueryDesc->pStats;
- SWR_CONTEXT *pContext = pDC->pContext;
-
- SWR_ASSERT(pStats != nullptr);
-
- for (uint32_t i = 0; i < pContext->NumWorkerThreads; ++i)
- {
- pStats->DepthPassCount += pContext->stats[i].DepthPassCount;
-
- pStats->IaVertices += pContext->stats[i].IaVertices;
- pStats->IaPrimitives += pContext->stats[i].IaPrimitives;
- pStats->VsInvocations += pContext->stats[i].VsInvocations;
- pStats->HsInvocations += pContext->stats[i].HsInvocations;
- pStats->DsInvocations += pContext->stats[i].DsInvocations;
- pStats->GsInvocations += pContext->stats[i].GsInvocations;
- pStats->PsInvocations += pContext->stats[i].PsInvocations;
- pStats->CInvocations += pContext->stats[i].CInvocations;
- pStats->CsInvocations += pContext->stats[i].CsInvocations;
- pStats->CPrimitives += pContext->stats[i].CPrimitives;
- pStats->GsPrimitives += pContext->stats[i].GsPrimitives;
-
- for (uint32_t stream = 0; stream < MAX_SO_STREAMS; ++stream)
- {
- pStats->SoPrimStorageNeeded[stream] += pContext->stats[i].SoPrimStorageNeeded[stream];
- pStats->SoNumPrimsWritten[stream] += pContext->stats[i].SoNumPrimsWritten[stream];
- }
- }
-}
-
template<SWR_FORMAT format>
void ClearRasterTile(uint8_t *pTileBuffer, simdvector &value)
{
void ProcessComputeBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t threadGroupId, void*& pSpillFillBuffer);
void ProcessSyncBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pUserData);
-void ProcessQueryStatsBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pUserData);
void ProcessClearBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pUserData);
void ProcessStoreTileBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pData);
void ProcessDiscardInvalidateTilesBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pData);
uint64_t userData3;
};
-struct QUERY_DESC
-{
- SWR_STATS* pStats;
-};
-
struct STORE_TILES_DESC
{
SWR_RENDERTARGET_ATTACHMENT attachment;
CLEAR,
DISCARDINVALIDATETILES,
STORETILES,
- QUERYSTATS,
};
struct BE_WORK
CLEAR_DESC clear;
DISCARD_INVALIDATE_TILES_DESC discardInvalidateTiles;
STORE_TILES_DESC storeTiles;
- QUERY_DESC queryStats;
} desc;
};
CLEAR_DESC clear;
DISCARD_INVALIDATE_TILES_DESC discardInvalidateTiles;
STORE_TILES_DESC storeTiles;
- QUERY_DESC queryStats;
} desc;
};
pTileMgr->enqueue(0, 0, &work);
}
-//////////////////////////////////////////////////////////////////////////
-/// @brief FE handler for SwrGetStats.
-/// @param pContext - pointer to SWR context.
-/// @param pDC - pointer to draw context.
-/// @param workerId - thread's worker id. Even thread has a unique id.
-/// @param pUserData - Pointer to user data passed back to stats callback.
-/// @todo This should go away when we switch this to use compute threading.
-void ProcessQueryStats(
- SWR_CONTEXT *pContext,
- DRAW_CONTEXT *pDC,
- uint32_t workerId,
- void *pUserData)
-{
- QUERY_DESC *pQueryStats = (QUERY_DESC*)pUserData;
- BE_WORK work;
- work.type = QUERYSTATS;
- work.pfnWork = ProcessQueryStatsBE;
- work.desc.queryStats = *pQueryStats;
-
- MacroTileMgr *pTileMgr = pDC->pTileMgr;
- pTileMgr->enqueue(0, 0, &work);
-}
-
//////////////////////////////////////////////////////////////////////////
/// @brief FE handler for SwrClearRenderTarget.
/// @param pContext - pointer to SWR context.
void ProcessStoreTiles(SWR_CONTEXT *pContext, DRAW_CONTEXT *pDC, uint32_t workerId, void *pUserData);
void ProcessDiscardInvalidateTiles(SWR_CONTEXT *pContext, DRAW_CONTEXT *pDC, uint32_t workerId, void *pUserData);
void ProcessSync(SWR_CONTEXT *pContext, DRAW_CONTEXT *pDC, uint32_t workerId, void *pUserData);
-void ProcessQueryStats(SWR_CONTEXT *pContext, DRAW_CONTEXT *pDC, uint32_t workerId, void *pUserData);
PFN_PROCESS_PRIMS GetBinTrianglesFunc(bool IsConservative);