summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-08-16 12:40:47 -0600
committerTim Rowley <[email protected]>2016-08-17 17:08:55 -0500
commit2a25ce7472a64963cfd6c49f026d4c235940629b (patch)
tree5a828e5c498bc457cecb79d3bbd3bb517f04d232
parent550503e776aaca0207184a6454de6aedc8c88aac (diff)
swr: [rasterizer core] make dirtytile list point directly to macrotilequeues
Speeds up high geometry HPC workloads. Signed-off-by: Tim Rowley <[email protected]>
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/threads.cpp20
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp3
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/tilemgr.h6
3 files changed, 15 insertions, 14 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/threads.cpp b/src/gallium/drivers/swr/rasterizer/core/threads.cpp
index dce23b2486e..9665f09e2c8 100644
--- a/src/gallium/drivers/swr/rasterizer/core/threads.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/threads.cpp
@@ -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> &macroTiles = pDC->pTileMgr->getDirtyTiles();
+ auto &macroTiles = 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);
diff --git a/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp b/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp
index e0aa8dd0307..1bd1805b52b 100644
--- a/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp
@@ -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++;
diff --git a/src/gallium/drivers/swr/rasterizer/core/tilemgr.h b/src/gallium/drivers/swr/rasterizer/core/tilemgr.h
index 41d29ba0c7a..4ec02838ab9 100644
--- a/src/gallium/drivers/swr/rasterizer/core/tilemgr.h
+++ b/src/gallium/drivers/swr/rasterizer/core/tilemgr.h
@@ -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 };