// initialize hot tile manager
pContext->pHotTileMgr = new HotTileMgr();
- // initialize function pointer tables
- InitClearTilesTable();
-
// initialize callback functions
pContext->pfnLoadTile = pCreateInfo->pfnLoadTile;
pContext->pfnStoreTile = pCreateInfo->pfnStoreTile;
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)
{
out_funcs.pfnSwrEnableStatsFE = SwrEnableStatsFE;
out_funcs.pfnSwrEnableStatsBE = SwrEnableStatsBE;
out_funcs.pfnSwrEndFrame = SwrEndFrame;
+ out_funcs.pfnSwrInit = SwrInit;
}
SWR_FUNC(void, SwrEndFrame,
HANDLE hContext);
+//////////////////////////////////////////////////////////////////////////
+/// @brief Initialize swr backend and memory internal tables
+SWR_FUNC(void, SwrInit);
+
struct SWR_INTERFACE
{
PFNSwrEnableStatsFE pfnSwrEnableStatsFE;
PFNSwrEnableStatsBE pfnSwrEnableStatsBE;
PFNSwrEndFrame pfnSwrEndFrame;
+ PFNSwrInit pfnSwrInit;
};
extern "C" {
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]
createInfo.pfnUpdateStatsFE = swr_UpdateStatsFE;
ctx->swrContext = SwrCreateContext(&createInfo);
- /* Init Load/Store/ClearTiles Tables */
- swr_InitMemoryModule();
-
- InitBackendFuncTables();
+ SwrInit();
if (ctx->swrContext == NULL)
goto fail;
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();
-}