summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/rasterizer
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2017-04-21 10:21:19 -0500
committerTim Rowley <[email protected]>2017-04-28 19:56:50 -0500
commit5fde2ae533cd739dec929248649c43e0c9e07e54 (patch)
treeb5868664e59ac56a224a9940e9bb29b8eecb4c3c /src/gallium/drivers/swr/rasterizer
parente8d58049f6409308f376c6b04f9d2fb20cb4de7c (diff)
swr/rast: add SwrInit() to init backend/memory tables
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer')
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/api.cpp23
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/api.h5
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/backend.h3
3 files changed, 25 insertions, 6 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp
index 4554aaa3ec7..a3870be6c7b 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 eacf0a84171..0b07608efb2 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 7787332281c..7bb1f5585fb 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]