CreateThreadPool(pContext, &pContext->threadPool);
- // Calling createThreadPool() above can set SINGLE_THREADED
- if (pContext->threadInfo.SINGLE_THREADED)
- {
- pContext->NumWorkerThreads = 1;
- pContext->NumFEThreads = 1;
- pContext->NumBEThreads = 1;
- }
-
pContext->ppScratch = new uint8_t*[pContext->NumWorkerThreads];
pContext->pStats = new SWR_STATS[pContext->NumWorkerThreads];
pCurDrawContext->threadsDone = 0;
pCurDrawContext->retireCallback.pfnCallbackFunc = nullptr;
- pCurDrawContext->dynState.Reset(pContext->threadPool.numThreads);
+ pCurDrawContext->dynState.Reset(pContext->NumWorkerThreads);
// Assign unique drawId for this DC
pCurDrawContext->drawId = pContext->dcRing.GetHead();
SWR_STATS* pSavePtr = pStats;
memset(this, 0, sizeof(*this));
pStats = pSavePtr;
- memset(pStats, 0, sizeof(SWR_STATS) * (numThreads ? numThreads : 1));
+ memset(pStats, 0, sizeof(SWR_STATS) * numThreads);
}
///@todo Currently assumes only a single FE can do stream output for a draw.
uint32_t SoWriteOffset[4];
}
else
{
- pPool->numThreads = 0;
- numThreads = 1;
pContext->threadInfo.SINGLE_THREADED = true;
}
}
}
}
+ if (pContext->threadInfo.SINGLE_THREADED)
+ {
+ numThreads = 1;
+ }
+
// Initialize DRAW_CONTEXT's per-thread stats
for (uint32_t dc = 0; dc < KNOB_MAX_DRAWS_IN_FLIGHT; ++dc)
{
if (pContext->threadInfo.SINGLE_THREADED)
{
+ pContext->NumWorkerThreads = 1;
+ pContext->NumFEThreads = 1;
+ pContext->NumBEThreads = 1;
+ pPool->numThreads = 0;
+
return;
}
-
pPool->numThreads = numThreads;
pContext->NumWorkerThreads = pPool->numThreads;