diff options
author | Tim Rowley <[email protected]> | 2016-10-30 19:27:07 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-11-14 09:02:25 -0600 |
commit | 584b65ad442f8219c0216961641d4b9f4a1671da (patch) | |
tree | 92850c4dddbb624278fe20340f3f2c86be8522e4 /src/gallium/drivers/swr/rasterizer/archrast | |
parent | e6f7d8a0946822d2f90099df2bf2a3d0969ebd74 (diff) |
swr: [rasterizer archrast] don't generate empty files
Don't generate files when no events have been generated outside
the header events.
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/archrast')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp | 16 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/archrast/archrast.h | 8 |
2 files changed, 21 insertions, 3 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp b/src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp index 574098d80a8..16b6d3347ac 100644 --- a/src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp +++ b/src/gallium/drivers/swr/rasterizer/archrast/archrast.cpp @@ -53,19 +53,31 @@ namespace ArchRast } // Construct an event manager and associate a handler with it. - HANDLE CreateThreadContext() + HANDLE CreateThreadContext(AR_THREAD type) { // Can we assume single threaded here? static std::atomic<uint32_t> counter(0); uint32_t id = counter.fetch_add(1); EventManager* pManager = new EventManager(); - EventHandler* pHandler = new EventHandlerStatsFile(id); + EventHandlerFile* pHandler = new EventHandlerStatsFile(id); if (pManager && pHandler) { pManager->Attach(pHandler); + if (type == AR_THREAD::API) + { + ThreadStartApiEvent e; + pManager->Dispatch(e); + } + else + { + ThreadStartWorkerEvent e; + pManager->Dispatch(e); + } + pHandler->MarkHeader(); + return pManager; } diff --git a/src/gallium/drivers/swr/rasterizer/archrast/archrast.h b/src/gallium/drivers/swr/rasterizer/archrast/archrast.h index e6376f208fe..4783144fcb5 100644 --- a/src/gallium/drivers/swr/rasterizer/archrast/archrast.h +++ b/src/gallium/drivers/swr/rasterizer/archrast/archrast.h @@ -32,7 +32,13 @@ namespace ArchRast { - HANDLE CreateThreadContext(); + enum class AR_THREAD + { + API = 0, + WORKER = 1 + }; + + HANDLE CreateThreadContext(AR_THREAD type); void DestroyThreadContext(HANDLE hThreadContext); // Dispatch event for this thread. |