Mesa (master): swr/rast: add SwrInit() to init backend/memory tables

Tim Rowley torowley at kemper.freedesktop.org
Sat Apr 29 01:03:09 UTC 2017


Module: Mesa
Branch: master
Commit: 5fde2ae533cd739dec929248649c43e0c9e07e54
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fde2ae533cd739dec929248649c43e0c9e07e54

Author: Tim Rowley <timothy.o.rowley at intel.com>
Date:   Fri Apr 21 10:21:19 2017 -0500

swr/rast: add SwrInit() to init backend/memory tables

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>

---

 src/gallium/drivers/swr/rasterizer/core/api.cpp   | 23 ++++++++++++++++++++---
 src/gallium/drivers/swr/rasterizer/core/api.h     |  5 +++++
 src/gallium/drivers/swr/rasterizer/core/backend.h |  3 ---
 src/gallium/drivers/swr/swr_context.cpp           |  5 +----
 src/gallium/drivers/swr/swr_memory.h              | 12 ------------
 5 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp
index 4554aaa3ec..a3870be6c7 100644
--- a/src/gallium/drivers/swr/rasterizer/core/api.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp
@@ -143,9 +143,6 @@ HANDLE SwrCreateContext(
     // initialize hot tile manager
     pContext->pHotTileMgr = new HotTileMgr();
 
-    // initialize function pointer tables
-    InitClearTilesTable();
-
     // initialize callback functions
     pContext->pfnLoadTile = pCreateInfo->pfnLoadTile;
     pContext->pfnStoreTile = pCreateInfo->pfnStoreTile;
@@ -1641,6 +1638,25 @@ void SWR_API SwrEndFrame(
     pContext->frameCount++;
 }
 
+void InitSimLoadTilesTable();
+void InitSimStoreTilesTable();
+void InitSimClearTilesTable();
+
+void InitClearTilesTable();
+void InitBackendFuncTables();
+
+//////////////////////////////////////////////////////////////////////////
+/// @brief Initialize swr backend and memory internal tables
+void SwrInit()
+{
+    InitSimLoadTilesTable();
+    InitSimStoreTilesTable();
+    InitSimClearTilesTable();
+
+    InitClearTilesTable();
+    InitBackendFuncTables();
+}
+
 
 void SwrGetInterface(SWR_INTERFACE &out_funcs)
 {
@@ -1688,4 +1704,5 @@ void SwrGetInterface(SWR_INTERFACE &out_funcs)
     out_funcs.pfnSwrEnableStatsFE = SwrEnableStatsFE;
     out_funcs.pfnSwrEnableStatsBE = SwrEnableStatsBE;
     out_funcs.pfnSwrEndFrame = SwrEndFrame;
+    out_funcs.pfnSwrInit = SwrInit;
 }
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.h b/src/gallium/drivers/swr/rasterizer/core/api.h
index eacf0a8417..0b07608efb 100644
--- a/src/gallium/drivers/swr/rasterizer/core/api.h
+++ b/src/gallium/drivers/swr/rasterizer/core/api.h
@@ -655,6 +655,10 @@ SWR_FUNC(void, SwrEnableStatsBE,
 SWR_FUNC(void, SwrEndFrame,
     HANDLE hContext);
 
+//////////////////////////////////////////////////////////////////////////
+/// @brief Initialize swr backend and memory internal tables
+SWR_FUNC(void, SwrInit);
+
 
 struct SWR_INTERFACE
 {
@@ -702,6 +706,7 @@ struct SWR_INTERFACE
     PFNSwrEnableStatsFE pfnSwrEnableStatsFE;
     PFNSwrEnableStatsBE pfnSwrEnableStatsBE;
     PFNSwrEndFrame pfnSwrEndFrame;
+    PFNSwrInit pfnSwrInit;
 };
 
 extern "C" {
diff --git a/src/gallium/drivers/swr/rasterizer/core/backend.h b/src/gallium/drivers/swr/rasterizer/core/backend.h
index 7787332281..7bb1f5585f 100644
--- a/src/gallium/drivers/swr/rasterizer/core/backend.h
+++ b/src/gallium/drivers/swr/rasterizer/core/backend.h
@@ -41,10 +41,7 @@ void ProcessStoreTilesBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTil
 void ProcessDiscardInvalidateTilesBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pData);
 void ProcessShutdownBE(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pUserData);
 void BackendNullPS(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t x, uint32_t y, SWR_TRIANGLE_DESC &work, RenderOutputBuffers &renderBuffers);
-void InitClearTilesTable();
 simdmask ComputeUserClipMask(uint8_t clipMask, float* pUserClipBuffer, simdscalar vI, simdscalar vJ);
-void InitBackendFuncTables();
-void InitCPSFuncTables();
 void CalcSampleBarycentrics(const BarycentricCoeffs& coeffs, SWR_PS_CONTEXT &psContext);
 
 extern PFN_BACKEND_FUNC gBackendPixelRateTable[SWR_MULTISAMPLE_TYPE_COUNT]
diff --git a/src/gallium/drivers/swr/swr_context.cpp b/src/gallium/drivers/swr/swr_context.cpp
index aa5cca8e65..e8e465196d 100644
--- a/src/gallium/drivers/swr/swr_context.cpp
+++ b/src/gallium/drivers/swr/swr_context.cpp
@@ -553,10 +553,7 @@ swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
    createInfo.pfnUpdateStatsFE = swr_UpdateStatsFE;
    ctx->swrContext = SwrCreateContext(&createInfo);
 
-   /* Init Load/Store/ClearTiles Tables */
-   swr_InitMemoryModule();
-
-   InitBackendFuncTables();
+   SwrInit();
 
    if (ctx->swrContext == NULL)
       goto fail;
diff --git a/src/gallium/drivers/swr/swr_memory.h b/src/gallium/drivers/swr/swr_memory.h
index b8ce27f4d9..49b208ff35 100644
--- a/src/gallium/drivers/swr/swr_memory.h
+++ b/src/gallium/drivers/swr/swr_memory.h
@@ -87,15 +87,3 @@ swr_StoreHotTileClear(HANDLE hPrivateContext,
 
    StoreHotTileClear(pDstSurface, renderTargetIndex, x, y, renderTargetArrayIndex, pClearColor);
 }
-
-void InitSimLoadTilesTable();
-void InitSimStoreTilesTable();
-void InitSimClearTilesTable();
-
-/* Init Load/Store/ClearTiles Tables */
-INLINE void swr_InitMemoryModule()
-{
-   InitSimLoadTilesTable();
-   InitSimStoreTilesTable();
-   InitSimClearTilesTable();
-}




More information about the mesa-commit mailing list