OSDN Git Service

swr: [rasterizer archrast] Add thread tags to event files.
[android-x86/external-mesa.git] / src / gallium / drivers / swr / rasterizer / core / api.cpp
index 2269240..e67ede2 100644 (file)
@@ -112,10 +112,11 @@ HANDLE SwrCreateContext(
     pContext->ppScratch = new uint8_t*[pContext->NumWorkerThreads];
     pContext->pStats = new SWR_STATS[pContext->NumWorkerThreads];
 
-#if KNOB_ENABLE_AR
+#if defined(KNOB_ENABLE_AR)
     // Setup ArchRast thread contexts which includes +1 for API thread.
     pContext->pArContext = new HANDLE[pContext->NumWorkerThreads+1];
     pContext->pArContext[pContext->NumWorkerThreads] = ArchRast::CreateThreadContext();
+    _AR_EVENT(pContext->pArContext[pContext->NumWorkerThreads], ThreadStartApiEvent());
 #endif
 
     // Allocate scratch space for workers.
@@ -133,9 +134,10 @@ HANDLE SwrCreateContext(
         pContext->ppScratch[i] = (uint8_t*)AlignedMalloc(32 * sizeof(KILOBYTE), KNOB_SIMD_WIDTH * 4);
 #endif
 
-#if KNOB_ENABLE_AR
+#if defined(KNOB_ENABLE_AR)
         // Initialize worker thread context for ArchRast.
         pContext->pArContext[i] = ArchRast::CreateThreadContext();
+        _AR_EVENT(pContext->pArContext[i], ThreadStartWorkerEvent());
 #endif
     }
 
@@ -383,7 +385,7 @@ void SwrDestroyContext(HANDLE hContext)
         AlignedFree(pContext->ppScratch[i]);
 #endif
 
-#if KNOB_ENABLE_AR
+#if defined(KNOB_ENABLE_AR)
         ArchRast::DestroyThreadContext(pContext->pArContext[i]);
 #endif
     }