void SetupDefaultState(SWR_CONTEXT *pContext);
+static INLINE SWR_CONTEXT* GetContext(HANDLE hContext)
+{
+ return (SWR_CONTEXT*)hContext;
+}
+
//////////////////////////////////////////////////////////////////////////
/// @brief Create SWR Context.
/// @param pCreateInfo - pointer to creation info.
void SwrDestroyContext(HANDLE hContext)
{
- SWR_CONTEXT *pContext = (SWR_CONTEXT*)hContext;
+ SWR_CONTEXT *pContext = GetContext(hContext);
DestroyThreadPool(pContext, &pContext->threadPool);
// free the fifos
delete(pContext->pHotTileMgr);
pContext->~SWR_CONTEXT();
- AlignedFree((SWR_CONTEXT*)hContext);
+ AlignedFree(GetContext(hContext));
}
void CopyState(DRAW_STATE& dst, const DRAW_STATE& src)
void* pOutputStateBlock,
size_t memSize)
{
- SWR_CONTEXT *pContext = (SWR_CONTEXT*)hContext;
+ SWR_CONTEXT *pContext = GetContext(hContext);
auto pSrc = GetDrawState(pContext);
SWR_ASSERT(pOutputStateBlock && memSize >= sizeof(*pSrc));
const void* pStateBlock,
size_t memSize)
{
- SWR_CONTEXT *pContext = (SWR_CONTEXT*)hContext;
+ SWR_CONTEXT *pContext = GetContext(hContext);
auto pDst = GetDrawState(pContext);
SWR_ASSERT(pStateBlock && memSize >= sizeof(*pDst));
pState->rastState.frontWinding = SWR_FRONTWINDING_CCW;
}
-static INLINE SWR_CONTEXT* GetContext(HANDLE hContext)
-{
- return (SWR_CONTEXT*)hContext;
-}
-
void SwrSync(HANDLE hContext, PFN_CALLBACK_FUNC pfnFunc, uint64_t userData, uint64_t userData2, uint64_t userData3)
{
RDTSC_START(APISync);
return;
}
- SWR_CONTEXT *pContext = (SWR_CONTEXT*)hContext;
+ SWR_CONTEXT *pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
pDC->FeWork.type = DISCARDINVALIDATETILES;
return;
}
- SWR_CONTEXT *pContext = (SWR_CONTEXT*)hContext;
+ SWR_CONTEXT *pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
// Queue a load to the hottile
}
RDTSC_START(APIDispatch);
- SWR_CONTEXT *pContext = (SWR_CONTEXT*)hContext;
+ SWR_CONTEXT *pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
pDC->isCompute = true; // This is a compute context.
RDTSC_START(APIStoreTiles);
- SWR_CONTEXT *pContext = (SWR_CONTEXT*)hContext;
+ SWR_CONTEXT *pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
SetupMacroTileScissors(pDC);
RDTSC_START(APIClearRenderTarget);
- SWR_CONTEXT *pContext = (SWR_CONTEXT*)hContext;
+ SWR_CONTEXT *pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);