pContext->pfnUpdateSoWriteOffset = pCreateInfo->pfnUpdateSoWriteOffset;
pContext->pfnUpdateStats = pCreateInfo->pfnUpdateStats;
pContext->pfnUpdateStatsFE = pCreateInfo->pfnUpdateStatsFE;
+
// pass pointer to bucket manager back to caller
#ifdef KNOB_ENABLE_RDTSC
pCurDrawContext->drawId = pContext->dcRing.GetHead();
pCurDrawContext->cleanupState = true;
+
}
else
{
extern PFN_BACKEND_FUNC gBackendSampleRateTable[SWR_MULTISAMPLE_TYPE_COUNT][SWR_INPUT_COVERAGE_COUNT][2][2];
void SetupPipeline(DRAW_CONTEXT *pDC)
{
+ SWR_CONTEXT* pContext = pDC->pContext;
DRAW_STATE* pState = pDC->pState;
const SWR_RASTSTATE &rastState = pState->state.rastState;
const SWR_PS_STATE &psState = pState->state.psState;
break;
};
+
// disable clipper if viewport transform is disabled
if (pState->state.frontendState.vpTransformDisable)
{
pState->pfnProcessPrims = nullptr;
}
+
// set up the frontend attribute count
pState->state.feNumAttributes = 0;
const SWR_BACKEND_STATE& backendState = pState->state.backendState;
SetupMacroTileScissors(pDC);
SetupPipeline(pDC);
}
+
+
}
//////////////////////////////////////////////////////////////////////////
pState->rastState.cullMode = SWR_CULLMODE_NONE;
}
+
int draw = 0;
while (remainingVerts)
{
pDC = GetDrawContext(pContext);
pDC->pState->state.rastState.cullMode = oldCullMode;
+
AR_API_END(APIDraw, numVertices * numInstances);
}
pState->rastState.cullMode = SWR_CULLMODE_NONE;
}
+
while (remainingIndices)
{
uint32_t numIndicesForDraw = (remainingIndices < maxIndicesPerDraw) ?
// When breaking up draw, we need to obtain new draw context for each iteration.
bool isSplitDraw = (draw > 0) ? true : false;
+
pDC = GetDrawContext(pContext, isSplitDraw);
InitDraw(pDC, isSplitDraw);
draw++;
}
- // restore culling state
+ // Restore culling state
pDC = GetDrawContext(pContext);
pDC->pState->state.rastState.cullMode = oldCullMode;
+
AR_API_END(APIDrawIndexed, numIndices * numInstances);
}
pContext->frameCount++;
}
+
_simd_store_si((simdscalari*)aRTAI, _simd_setzero_si());
}
+endBinTriangles:
+
// scan remaining valid triangles and bin each separately
while (_BitScanForward(&triIndex, triMask))
{
triMask &= ~(1 << triIndex);
}
-endBinTriangles:
AR_END(FEBinTriangles, 1);
}
return TemplateArgUnroller<FEBinTrianglesChooser>::GetFunc(IsConservative);
}
+
//////////////////////////////////////////////////////////////////////////
/// @brief Bin SIMD points to the backend. Only supports point size of 1
/// @param pDC - pointer to draw context.
void ExecuteStage(PA_STATE& pa, simdvector prim[], uint32_t primMask, simdscalari primId, simdscalari viewportIdx)
{
SWR_ASSERT(pa.pDC != nullptr);
-
- SWR_CONTEXT *pContext = pa.pDC->pContext;
+ SWR_CONTEXT* pContext = pa.pDC->pContext;
// set up binner based on PA state
PFN_PROCESS_PRIMS pfnBinner;
break;
};
+
// update clipper invocations pipeline stat
uint32_t numInvoc = _mm_popcnt_u32(primMask);
UPDATE_STAT_FE(CInvocations, numInvoc);