summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_context.cpp
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-08-06 20:10:14 -0600
committerTim Rowley <[email protected]>2016-08-10 11:08:51 -0500
commit4e8763cb0904c30d1962cf5ad52fe3a87be7b4bd (patch)
tree91663ae17dc89b20311e87569e9f0b8784e56219 /src/gallium/drivers/swr/swr_context.cpp
parentf833b694cd04d08ed4742cd49ae478948e4bca3a (diff)
swr: [rasterizer core] split FE and BE stats
Separated FE stats out into its own structure. There are 17 FE vs 3 BE stat fields. Since there is only one FE thread per DC then we don't have to loop over all threads and sum up FE stats over all the worker threads. This also reduces size of DC since we only need to store one copy of the FE stats and not one per worker. Finally, we can use the new FE callback mechanism to update these. Signed-off-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_context.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_context.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/swr_context.cpp b/src/gallium/drivers/swr/swr_context.cpp
index 53d2b93089b..15e60cddf0a 100644
--- a/src/gallium/drivers/swr/swr_context.cpp
+++ b/src/gallium/drivers/swr/swr_context.cpp
@@ -355,15 +355,29 @@ swr_UpdateStats(HANDLE hPrivateContext, const SWR_STATS *pStats)
struct swr_context *ctx = (struct swr_context *)pDC->swr_ctx;
SWR_STATS *pSwrStats = &ctx->stats;
+
pSwrStats->DepthPassCount += pStats->DepthPassCount;
+ pSwrStats->PsInvocations += pStats->PsInvocations;
+ pSwrStats->CsInvocations += pStats->CsInvocations;
+}
+
+static void
+swr_UpdateStatsFE(HANDLE hPrivateContext, const SWR_STATS_FE *pStats)
+{
+ swr_draw_context *pDC = (swr_draw_context*)hPrivateContext;
+
+ if (!pDC)
+ return;
+
+ struct swr_context *ctx = (struct swr_context *)pDC->swr_ctx;
+
+ SWR_STATS_FE *pSwrStats = &ctx->statsFE;
pSwrStats->IaVertices += pStats->IaVertices;
pSwrStats->IaPrimitives += pStats->IaPrimitives;
pSwrStats->VsInvocations += pStats->VsInvocations;
pSwrStats->HsInvocations += pStats->HsInvocations;
pSwrStats->DsInvocations += pStats->DsInvocations;
pSwrStats->GsInvocations += pStats->GsInvocations;
- pSwrStats->PsInvocations += pStats->PsInvocations;
- pSwrStats->CsInvocations += pStats->CsInvocations;
pSwrStats->CInvocations += pStats->CInvocations;
pSwrStats->CPrimitives += pStats->CPrimitives;
pSwrStats->GsPrimitives += pStats->GsPrimitives;
@@ -389,6 +403,7 @@ swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
createInfo.pfnStoreTile = swr_StoreHotTile;
createInfo.pfnClearTile = swr_StoreHotTileClear;
createInfo.pfnUpdateStats = swr_UpdateStats;
+ createInfo.pfnUpdateStatsFE = swr_UpdateStatsFE;
ctx->swrContext = SwrCreateContext(&createInfo);
/* Init Load/Store/ClearTiles Tables */