}
// Grab the list of all dirty macrotiles. A tile is dirty if it has work queued to it.
- std::vector<uint32_t> ¯oTiles = pDC->pTileMgr->getDirtyTiles();
+ auto ¯oTiles = pDC->pTileMgr->getDirtyTiles();
- for (uint32_t tileID : macroTiles)
+ for (auto tile : macroTiles)
{
+ uint32_t tileID = tile->mId;
+
// Only work on tiles for this numa node
uint32_t x, y;
pDC->pTileMgr->getTileIndices(tileID, x, y);
continue;
}
- MacroTileQueue &tile = pDC->pTileMgr->getMacroTileQueue(tileID);
-
- if (!tile.getNumQueued())
+ if (!tile->getNumQueued())
{
continue;
}
continue;
}
- if (tile.tryLock())
+ if (tile->tryLock())
{
BE_WORK *pWork;
RDTSC_START(WorkerFoundWork);
- uint32_t numWorkItems = tile.getNumQueued();
+ uint32_t numWorkItems = tile->getNumQueued();
SWR_ASSERT(numWorkItems);
- pWork = tile.peek();
+ pWork = tile->peek();
SWR_ASSERT(pWork);
if (pWork->type == DRAW)
{
pContext->pHotTileMgr->InitializeHotTiles(pContext, pDC, tileID);
}
- while ((pWork = tile.peek()) != nullptr)
+ while ((pWork = tile->peek()) != nullptr)
{
pWork->pfnWork(pDC, workerId, tileID, &pWork->desc);
- tile.dequeue();
+ tile->dequeue();
}
RDTSC_STOP(WorkerFoundWork, numWorkItems, pDC->drawId);
///@todo This will all be private.
uint32_t mWorkItemsFE = 0;
uint32_t mWorkItemsBE = 0;
+ uint32_t mId = 0;
private:
QUEUE<BE_WORK> mFifo;
mDirtyTiles.clear();
}
- INLINE std::vector<uint32_t>& getDirtyTiles() { return mDirtyTiles; }
- INLINE MacroTileQueue& getMacroTileQueue(uint32_t id) { return mTiles[id]; }
+ INLINE std::vector<MacroTileQueue*>& getDirtyTiles() { return mDirtyTiles; }
void markTileComplete(uint32_t id);
INLINE bool isWorkComplete()
std::unordered_map<uint32_t, MacroTileQueue> mTiles;
// Any tile that has work queued to it is a dirty tile.
- std::vector<uint32_t> mDirtyTiles;
+ std::vector<MacroTileQueue*> mDirtyTiles;
OSALIGNLINE(LONG) mWorkItemsProduced { 0 };
OSALIGNLINE(volatile LONG) mWorkItemsConsumed { 0 };