summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-08-11 10:49:43 -0600
committerTim Rowley <[email protected]>2016-08-17 17:08:55 -0500
commitc7c1a03f909c15338b878418ae76498685aeb59b (patch)
tree45ef632f9eb105ebc8429df518947cd7b5cb470b /src/gallium/drivers/swr
parentb8c47175672063e45229b7cf82b79d1e97ec2943 (diff)
swr: [rasterizer core] move some global variables to SWR_CONTEXT
Signed-off-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/api.cpp14
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/context.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp
index 15485012a08..e447bf6fbe3 100644
--- a/src/gallium/drivers/swr/rasterizer/core/api.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp
@@ -199,8 +199,6 @@ void WakeAllThreads(SWR_CONTEXT *pContext)
pContext->FifosNotEmpty.notify_all();
}
-static TileSet gSingleThreadLockedTiles;
-
template<bool IsDraw>
void QueueWork(SWR_CONTEXT *pContext)
{
@@ -240,7 +238,7 @@ void QueueWork(SWR_CONTEXT *pContext)
{
uint32_t curDraw[2] = { pContext->pCurDrawContext->drawId, pContext->pCurDrawContext->drawId };
WorkOnFifoFE(pContext, 0, curDraw[0]);
- WorkOnFifoBE(pContext, 0, curDraw[1], gSingleThreadLockedTiles, 0, 0);
+ WorkOnFifoBE(pContext, 0, curDraw[1], pContext->singleThreadLockedTiles, 0, 0);
}
else
{
@@ -291,16 +289,14 @@ DRAW_CONTEXT* GetDrawContext(SWR_CONTEXT *pContext, bool isSplitDraw = false)
uint64_t curDraw = pContext->dcRing.GetHead();
uint32_t dcIndex = curDraw % KNOB_MAX_DRAWS_IN_FLIGHT;
- static uint64_t lastDrawChecked;
- static uint32_t lastFrameChecked;
- if ((pContext->frameCount - lastFrameChecked) > 2 ||
- (curDraw - lastDrawChecked) > 0x10000)
+ if ((pContext->frameCount - pContext->lastFrameChecked) > 2 ||
+ (curDraw - pContext->lastDrawChecked) > 0x10000)
{
// Take this opportunity to clean-up old arena allocations
pContext->cachingArenaAllocator.FreeOldBlocks();
- lastFrameChecked = pContext->frameCount;
- lastDrawChecked = curDraw;
+ pContext->lastFrameChecked = pContext->frameCount;
+ pContext->lastDrawChecked = curDraw;
}
DRAW_CONTEXT* pCurDrawContext = &pContext->dcRing[dcIndex];
diff --git a/src/gallium/drivers/swr/rasterizer/core/context.h b/src/gallium/drivers/swr/rasterizer/core/context.h
index 320aa924c4f..0a85ebe30a5 100644
--- a/src/gallium/drivers/swr/rasterizer/core/context.h
+++ b/src/gallium/drivers/swr/rasterizer/core/context.h
@@ -488,6 +488,10 @@ struct SWR_CONTEXT
CachingAllocator cachingArenaAllocator;
uint32_t frameCount;
+
+ uint32_t lastFrameChecked;
+ uint64_t lastDrawChecked;
+ TileSet singleThreadLockedTiles;
};
void WaitForDependencies(SWR_CONTEXT *pContext, uint64_t drawId);