swr: [rasterizer core] stop single threaded crash exit crash
authorTim Rowley <timothy.o.rowley@intel.com>
Fri, 10 Jun 2016 16:18:45 +0000 (10:18 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Thu, 23 Jun 2016 15:50:36 +0000 (10:50 -0500)
Function static destructors were getting called by exit
handlers before context teardown.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/core/api.cpp

index 2e6f8b3a16da3793288a51e19c6bcc445023d92f..22a94fbf731ab1568ea14de1b52bce0623c7f2c2 100644 (file)
@@ -181,6 +181,8 @@ void WakeAllThreads(SWR_CONTEXT *pContext)
     pContext->FifosNotEmpty.notify_all();
 }
 
+static TileSet gSingleThreadLockedTiles;
+
 template<bool IsDraw>
 void QueueWork(SWR_CONTEXT *pContext)
 {
@@ -213,10 +215,9 @@ void QueueWork(SWR_CONTEXT *pContext)
 
         if (IsDraw)
         {
-            static TileSet lockedTiles;
             uint64_t curDraw[2] = { pContext->pCurDrawContext->drawId, pContext->pCurDrawContext->drawId };
             WorkOnFifoFE(pContext, 0, curDraw[0]);
-            WorkOnFifoBE(pContext, 0, curDraw[1], lockedTiles, 0, 0);
+            WorkOnFifoBE(pContext, 0, curDraw[1], gSingleThreadLockedTiles, 0, 0);
         }
         else
         {