swr: [rasterizer core] make dirtytile list point directly to macrotilequeues
Speeds up high geometry HPC workloads. Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
This commit is contained in:
parent
550503e776
commit
2a25ce7472
|
@ -465,10 +465,12 @@ void WorkOnFifoBE(
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
@ -477,9 +479,7 @@ void WorkOnFifoBE(
|
|||
continue;
|
||||
}
|
||||
|
||||
MacroTileQueue &tile = pDC->pTileMgr->getMacroTileQueue(tileID);
|
||||
|
||||
if (!tile.getNumQueued())
|
||||
if (!tile->getNumQueued())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -490,26 +490,26 @@ void WorkOnFifoBE(
|
|||
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);
|
||||
|
||||
|
|
|
@ -54,11 +54,12 @@ void MacroTileMgr::enqueue(uint32_t x, uint32_t y, BE_WORK *pWork)
|
|||
|
||||
MacroTileQueue &tile = mTiles[id];
|
||||
tile.mWorkItemsFE++;
|
||||
tile.mId = id;
|
||||
|
||||
if (tile.mWorkItemsFE == 1)
|
||||
{
|
||||
tile.clear(mArena);
|
||||
mDirtyTiles.push_back(id);
|
||||
mDirtyTiles.push_back(&tile);
|
||||
}
|
||||
|
||||
mWorkItemsProduced++;
|
||||
|
|
|
@ -95,6 +95,7 @@ struct MacroTileQueue
|
|||
///@todo This will all be private.
|
||||
uint32_t mWorkItemsFE = 0;
|
||||
uint32_t mWorkItemsBE = 0;
|
||||
uint32_t mId = 0;
|
||||
|
||||
private:
|
||||
QUEUE<BE_WORK> mFifo;
|
||||
|
@ -123,8 +124,7 @@ public:
|
|||
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()
|
||||
|
@ -145,7 +145,7 @@ private:
|
|||
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 };
|
||||
|
|
Loading…
Reference in New Issue