class BucketManager
{
public:
- BucketManager() {}
+
+ uint32_t mCurrentFrame;
+ std::vector<uint32_t> mBucketMap;
+ bool mBucketsInitialized;
+ std::string mBucketMgrName;
+
+
+ BucketManager(std::string name) : mCurrentFrame(0), mBucketsInitialized(false), mBucketMgrName(name)
+ {
+ mBucketMap.clear();
+ }
~BucketManager();
// removes all registered thread data
/// @param pCreateInfo - pointer to creation info.
HANDLE SwrCreateContext(SWR_CREATECONTEXT_INFO* pCreateInfo)
{
- RDTSC_RESET();
- RDTSC_INIT(0);
-
void* pContextMem = AlignedMalloc(sizeof(SWR_CONTEXT), KNOB_SIMD_WIDTH * 4);
memset(pContextMem, 0, sizeof(SWR_CONTEXT));
SWR_CONTEXT* pContext = new (pContextMem) SWR_CONTEXT();
ArchRast::CreateThreadContext(ArchRast::AR_THREAD::API);
#endif
+#if defined(KNOB_ENABLE_RDTSC)
+ pContext->pBucketMgr = new BucketManager(pCreateInfo->contextName);
+ RDTSC_RESET(pContext->pBucketMgr);
+ RDTSC_INIT(pContext->pBucketMgr, 0);
+#endif
+
// Allocate scratch space for workers.
///@note We could lazily allocate this but its rather small amount of memory.
for (uint32_t i = 0; i < pContext->NumWorkerThreads; ++i)
// pass pointer to bucket manager back to caller
#ifdef KNOB_ENABLE_RDTSC
- pCreateInfo->pBucketMgr = &gBucketMgr;
+ pCreateInfo->pBucketMgr = pContext->pBucketMgr;
#endif
pCreateInfo->contextSaveSize = sizeof(API_STATE);
}
else
{
- RDTSC_BEGIN(APIDrawWakeAllThreads, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, APIDrawWakeAllThreads, pDC->drawId);
WakeAllThreads(pContext);
- RDTSC_END(APIDrawWakeAllThreads, 1);
+ RDTSC_END(pContext->pBucketMgr, APIDrawWakeAllThreads, 1);
}
// Set current draw context to NULL so that next state call forces a new draw context to be
DRAW_CONTEXT* GetDrawContext(SWR_CONTEXT* pContext, bool isSplitDraw = false)
{
- RDTSC_BEGIN(APIGetDrawContext, 0);
+ RDTSC_BEGIN(pContext->pBucketMgr, APIGetDrawContext, 0);
// If current draw context is null then need to obtain a new draw context to use from ring.
if (pContext->pCurDrawContext == nullptr)
{
SWR_ASSERT(isSplitDraw == false, "Split draw should only be used when obtaining a new DC");
}
- RDTSC_END(APIGetDrawContext, 0);
+ RDTSC_END(pContext->pBucketMgr, APIGetDrawContext, 0);
return pContext->pCurDrawContext;
}
#endif
}
+#if defined(KNOB_ENABLE_RDTSC)
+ delete pContext->pBucketMgr;
+#endif
+
delete[] pContext->ppScratch;
AlignedFree(pContext->pStats);
SWR_CONTEXT* pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
- RDTSC_BEGIN(APISync, 0);
+ RDTSC_BEGIN(pContext->pBucketMgr, APISync, 0);
pDC->FeWork.type = SYNC;
pDC->FeWork.pfnWork = ProcessSync;
// enqueue
QueueDraw(pContext);
- RDTSC_END(APISync, 1);
+ RDTSC_END(pContext->pBucketMgr, APISync, 1);
}
void SwrStallBE(HANDLE hContext)
{
SWR_CONTEXT* pContext = GetContext(hContext);
- RDTSC_BEGIN(APIWaitForIdle, 0);
+ RDTSC_BEGIN(pContext->pBucketMgr, APIWaitForIdle, 0);
while (!pContext->dcRing.IsEmpty())
{
_mm_pause();
}
- RDTSC_END(APIWaitForIdle, 1);
+ RDTSC_END(pContext->pBucketMgr, APIWaitForIdle, 1);
}
void SwrWaitForIdleFE(HANDLE hContext)
{
SWR_CONTEXT* pContext = GetContext(hContext);
- RDTSC_BEGIN(APIWaitForIdle, 0);
+ RDTSC_BEGIN(pContext->pBucketMgr, APIWaitForIdle, 0);
while (pContext->drawsOutstandingFE > 0)
{
_mm_pause();
}
- RDTSC_END(APIWaitForIdle, 1);
+ RDTSC_END(pContext->pBucketMgr, APIWaitForIdle, 1);
}
void SwrSetVertexBuffers(HANDLE hContext,
SWR_CONTEXT* pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
- RDTSC_BEGIN(APIDraw, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, APIDraw, pDC->drawId);
uint32_t maxVertsPerDraw = MaxVertsPerDraw(pDC, numVertices, topology);
uint32_t primsPerDraw = GetNumPrims(topology, maxVertsPerDraw);
pDC = GetDrawContext(pContext);
pDC->pState->state.rastState.cullMode = oldCullMode;
- RDTSC_END(APIDraw, numVertices * numInstances);
+ RDTSC_END(pContext->pBucketMgr, APIDraw, numVertices * numInstances);
}
//////////////////////////////////////////////////////////////////////////
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
API_STATE* pState = &pDC->pState->state;
- RDTSC_BEGIN(APIDrawIndexed, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, APIDrawIndexed, pDC->drawId);
uint32_t maxIndicesPerDraw = MaxVertsPerDraw(pDC, numIndices, topology);
uint32_t primsPerDraw = GetNumPrims(topology, maxIndicesPerDraw);
pDC = GetDrawContext(pContext);
pDC->pState->state.rastState.cullMode = oldCullMode;
- RDTSC_END(APIDrawIndexed, numIndices * numInstances);
+ RDTSC_END(pContext->pBucketMgr, APIDrawIndexed, numIndices * numInstances);
}
//////////////////////////////////////////////////////////////////////////
SWR_CONTEXT* pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
- RDTSC_BEGIN(APIDispatch, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, APIDispatch, pDC->drawId);
AR_API_EVENT(
DispatchEvent(pDC->drawId, threadGroupCountX, threadGroupCountY, threadGroupCountZ));
pDC->isCompute = true; // This is a compute context.
pDC->pDispatch->initialize(totalThreadGroups, pTaskData, &ProcessComputeBE);
QueueDispatch(pContext);
- RDTSC_END(APIDispatch, threadGroupCountX * threadGroupCountY * threadGroupCountZ);
+ RDTSC_END(pContext->pBucketMgr,
+ APIDispatch,
+ threadGroupCountX * threadGroupCountY * threadGroupCountZ);
}
// Deswizzles, converts and stores current contents of the hot tiles to surface
SWR_CONTEXT* pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
- RDTSC_BEGIN(APIStoreTiles, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, APIStoreTiles, pDC->drawId);
pDC->FeWork.type = STORETILES;
pDC->FeWork.pfnWork = ProcessStoreTiles;
AR_API_EVENT(SwrStoreTilesEvent(pDC->drawId));
- RDTSC_END(APIStoreTiles, 1);
+ RDTSC_END(pContext->pBucketMgr, APIStoreTiles, 1);
}
//////////////////////////////////////////////////////////////////////////
SWR_CONTEXT* pContext = GetContext(hContext);
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
- RDTSC_BEGIN(APIClearRenderTarget, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, APIClearRenderTarget, pDC->drawId);
pDC->FeWork.type = CLEAR;
pDC->FeWork.pfnWork = ProcessClear;
// enqueue draw
QueueDraw(pContext);
- RDTSC_END(APIClearRenderTarget, 1);
+ RDTSC_END(pContext->pBucketMgr, APIClearRenderTarget, 1);
}
//////////////////////////////////////////////////////////////////////////
DRAW_CONTEXT* pDC = GetDrawContext(pContext);
(void)pDC; // var used
- RDTSC_ENDFRAME();
+ RDTSC_ENDFRAME(pContext->pBucketMgr);
AR_API_EVENT(FrameEndEvent(pContext->frameCount, pDC->drawId));
pContext->frameCount++;
// Input: if set to non-zero value, overrides KNOB value for maximum
// number of draws in flight
uint32_t MAX_DRAWS_IN_FLIGHT;
+
+ std::string contextName;
};
//////////////////////////////////////////////////////////////////////////
{
SWR_CONTEXT* pContext = pDC->pContext;
- RDTSC_BEGIN(BEDispatch, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEDispatch, pDC->drawId);
const COMPUTE_DESC* pTaskData = (COMPUTE_DESC*)pDC->pDispatch->GetTasksData();
SWR_ASSERT(pTaskData != nullptr);
UPDATE_STAT_BE(CsInvocations, state.totalThreadsInGroup);
AR_EVENT(CSStats((HANDLE)&csContext.stats));
- RDTSC_END(BEDispatch, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEDispatch, 1);
}
//////////////////////////////////////////////////////////////////////////
SWR_CONTEXT* pContext = pDC->pContext;
HANDLE hWorkerPrivateData = pContext->threadPool.pThreadData[workerId].pWorkerPrivateData;
- RDTSC_BEGIN(BEStoreTiles, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEStoreTiles, pDC->drawId);
SWR_FORMAT srcFormat;
switch (attachment)
}
}
}
- RDTSC_END(BEStoreTiles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEStoreTiles, 1);
}
void ProcessStoreTilesBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pData)
SWR_TRIANGLE_DESC& work,
RenderOutputBuffers& renderBuffers)
{
- RDTSC_BEGIN(BENullBackend, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BENullBackend, pDC->drawId);
///@todo: handle center multisample pattern
- RDTSC_BEGIN(BESetup, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BESetup, pDC->drawId);
const API_STATE& state = GetApiState(pDC);
SWR_PS_CONTEXT psContext;
// skip SetupPixelShaderContext(&psContext, ...); // not needed here
- RDTSC_END(BESetup, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BESetup, 0);
simdscalar vYSamplePosUL = _simd_add_ps(vULOffsetsY, _simd_set1_ps(static_cast<float>(y)));
coverageMask &= CalcDepthBoundsAcceptMask(z, minz, maxz);
}
- RDTSC_BEGIN(BEBarycentric, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEBarycentric, pDC->drawId);
// calculate per sample positions
psContext.vX.sample = _simd_add_ps(vXSamplePosUL, samplePos.vX(sample));
psContext.vJ.sample);
psContext.vZ = state.pfnQuantizeDepth(psContext.vZ);
- RDTSC_END(BEBarycentric, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEBarycentric, 0);
// interpolate user clip distance if available
if (state.backendState.clipDistanceMask)
simdscalar vCoverageMask = _simd_vmask_ps(coverageMask);
simdscalar stencilPassMask = vCoverageMask;
- RDTSC_BEGIN(BEEarlyDepthTest, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEEarlyDepthTest, pDC->drawId);
simdscalar depthPassMask = DepthStencilTest(&state,
work.triFlags.frontFacing,
work.triFlags.viewportIndex,
vCoverageMask,
pStencilSample,
stencilPassMask);
- RDTSC_END(BEEarlyDepthTest, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEEarlyDepthTest, 0);
uint32_t statMask = _simd_movemask_ps(depthPassMask);
uint32_t statCount = _mm_popcnt_u32(statMask);
vYSamplePosUL = _simd_add_ps(vYSamplePosUL, dy);
}
- RDTSC_END(BENullBackend, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BENullBackend, 0);
}
PFN_CLEAR_TILES gClearTilesTable[NUM_SWR_FORMATS] = {};
SWR_ASSERT(pClear->attachmentMask != 0); // shouldn't be here without a reason.
- RDTSC_BEGIN(BEClear, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEClear, pDC->drawId);
if (pClear->attachmentMask & SWR_ATTACHMENT_MASK_COLOR)
{
pHotTile->state = HOTTILE_CLEAR;
}
- RDTSC_END(BEClear, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEClear, 1);
}
else
{
// Legacy clear
CLEAR_DESC* pClear = (CLEAR_DESC*)pUserData;
- RDTSC_BEGIN(BEClear, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEClear, pDC->drawId);
if (pClear->attachmentMask & SWR_ATTACHMENT_MASK_COLOR)
{
pClear->rect);
}
- RDTSC_END(BEClear, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEClear, 1);
}
}
_simd_vmask_ps(CalcDepthBoundsAcceptMask(z, minz, maxz)));
}
- RDTSC_BEGIN(BEBarycentric, pDC->drawId);
+ RDTSC_BEGIN(psContext.pBucketManager, BEBarycentric, pDC->drawId);
// calculate per sample positions
psContext.vX.sample = _simd_add_ps(psContext.vX.UL, samplePos.vX(sample));
vZ[sample] = state.pfnQuantizeDepth(vZ[sample]);
}
- RDTSC_END(BEBarycentric, 0);
+ RDTSC_END(psContext.pBucketManager, BEBarycentric, 0);
///@todo: perspective correct vs non-perspective correct clipping?
// if clip distances are enabled, we need to interpolate for each sample
// ZTest for this sample
///@todo Need to uncomment out this bucket.
- // RDTSC_BEGIN(BEDepthBucket, pDC->drawId);
+ // RDTSC_BEGIN(psContext.pBucketManager, BEDepthBucket, pDC->drawId);
depthPassMask[sample] = vCoverageMask[sample];
stencilPassMask[sample] = vCoverageMask[sample];
depthPassMask[sample] = DepthStencilTest(&state,
vCoverageMask[sample],
pStencilSample,
&stencilPassMask[sample]);
- // RDTSC_END(BEDepthBucket, 0);
+ // RDTSC_END(psContext.pBucketManager, BEDepthBucket, 0);
// early-exit if no pixels passed depth or earlyZ is forced on
if (psState.forceEarlyZ || !_simd_movemask_ps(depthPassMask[sample]))
/// backend
- RDTSC_BEGIN(BEPixelRateBackend, pDC->drawId);
- RDTSC_BEGIN(BESetup, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEPixelRateBackend, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BESetup, pDC->drawId);
const API_STATE& state = GetApiState(pDC);
state.colorHottileEnable,
renderBuffers);
- RDTSC_END(BESetup, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BESetup, 0);
PixelRateZTestLoop<T> PixelRateZTest(pDC,
workerId,
pCoverageMask, psContext.inputMask, state.blendState.sampleMask);
}
- RDTSC_BEGIN(BEBarycentric, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEBarycentric, pDC->drawId);
CalcPixelBarycentrics(coeffs, psContext);
CalcCentroid<T, false>(
&psContext, samplePos, coeffs, work.coverageMask, state.blendState.sampleMask);
- RDTSC_END(BEBarycentric, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEBarycentric, 0);
if (T::bForcedSampleCount)
{
if (state.psState.usesSourceDepth)
{
- RDTSC_BEGIN(BEBarycentric, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEBarycentric, pDC->drawId);
// interpolate and quantize z
psContext.vZ = vplaneps(
coeffs.vZa, coeffs.vZb, coeffs.vZc, psContext.vI.center, psContext.vJ.center);
psContext.vZ = state.pfnQuantizeDepth(psContext.vZ);
- RDTSC_END(BEBarycentric, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEBarycentric, 0);
}
// pixels that are currently active
psContext.oMask = T::MultisampleT::FullSampleMask();
// execute pixel shader
- RDTSC_BEGIN(BEPixelShader, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEPixelShader, pDC->drawId);
state.psState.pfnPixelShader(GetPrivateState(pDC), pWorkerData, &psContext);
UPDATE_STAT_BE(PsInvocations, _mm_popcnt_u32(_simd_movemask_ps(activeLanes)));
- RDTSC_END(BEPixelShader, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEPixelShader, 0);
// update stats
UPDATE_STAT_BE(PsInvocations, _mm_popcnt_u32(_simd_movemask_ps(activeLanes)));
for (uint32_t sample = 0; sample < GetNumOMSamples<T>(state.blendState.sampleCount);
sample++)
{
- RDTSC_BEGIN(BEOutputMerger, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEOutputMerger, pDC->drawId);
// center pattern does a single coverage/depth/stencil test, standard pattern tests
// all samples
uint32_t coverageSampleNum = (T::bIsCenterPattern) ? 0 : sample;
if (!_simd_movemask_ps(depthMask))
{
// stencil should already have been written in early/lateZ tests
- RDTSC_END(BEOutputMerger, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEOutputMerger, 0);
continue;
}
}
pStencilSample,
PixelRateZTest.stencilPassMask[coverageSampleNum]);
}
- RDTSC_END(BEOutputMerger, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEOutputMerger, 0);
}
Endtile:
- RDTSC_BEGIN(BEEndTile, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEEndTile, pDC->drawId);
for (uint32_t sample = 0; sample < T::MultisampleT::numCoverageSamples; sample++)
{
pStencilBuffer +=
(KNOB_SIMD_WIDTH * FormatTraits<KNOB_STENCIL_HOT_TILE_FORMAT>::bpp) / 8;
- RDTSC_END(BEEndTile, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEEndTile, 0);
psContext.vX.UL = _simd_add_ps(psContext.vX.UL, dx);
psContext.vX.center = _simd_add_ps(psContext.vX.center, dx);
psContext.vY.center = _simd_add_ps(psContext.vY.center, dy);
}
- RDTSC_END(BEPixelRateBackend, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEPixelRateBackend, 0);
}
template <uint32_t sampleCountT = SWR_MULTISAMPLE_1X,
SWR_TRIANGLE_DESC& work,
RenderOutputBuffers& renderBuffers)
{
- RDTSC_BEGIN(BESampleRateBackend, pDC->drawId);
- RDTSC_BEGIN(BESetup, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BESampleRateBackend, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BESetup, pDC->drawId);
void* pWorkerData = pDC->pContext->threadPool.pThreadData[workerId].pWorkerPrivateData;
const API_STATE& state = GetApiState(pDC);
state.colorHottileEnable,
renderBuffers);
- RDTSC_END(BESetup, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BESetup, 0);
psContext.vY.UL = _simd_add_ps(vULOffsetsY, _simd_set1_ps(static_cast<float>(y)));
psContext.vY.center = _simd_add_ps(vCenterOffsetsY, _simd_set1_ps(static_cast<float>(y)));
pCoverageMask, psContext.inputMask, state.blendState.sampleMask);
}
- RDTSC_BEGIN(BEBarycentric, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEBarycentric, pDC->drawId);
CalcPixelBarycentrics(coeffs, psContext);
CalcCentroid<T, false>(
&psContext, samplePos, coeffs, work.coverageMask, state.blendState.sampleMask);
- RDTSC_END(BEBarycentric, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEBarycentric, 0);
for (uint32_t sample = 0; sample < T::MultisampleT::numSamples; sample++)
{
coverageMask &= CalcDepthBoundsAcceptMask(z, minz, maxz);
}
- RDTSC_BEGIN(BEBarycentric, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEBarycentric, pDC->drawId);
// calculate per sample positions
psContext.vX.sample = _simd_add_ps(psContext.vX.UL, samplePos.vX(sample));
psContext.vJ.sample);
psContext.vZ = state.pfnQuantizeDepth(psContext.vZ);
- RDTSC_END(BEBarycentric, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEBarycentric, 0);
// interpolate user clip distance if available
if (state.backendState.clipDistanceMask)
// Early-Z?
if (T::bCanEarlyZ)
{
- RDTSC_BEGIN(BEEarlyDepthTest, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEEarlyDepthTest, pDC->drawId);
depthPassMask = DepthStencilTest(&state,
work.triFlags.frontFacing,
work.triFlags.viewportIndex,
AR_EVENT(EarlyDepthStencilInfoSampleRate(_simd_movemask_ps(depthPassMask),
_simd_movemask_ps(stencilPassMask),
_simd_movemask_ps(vCoverageMask)));
- RDTSC_END(BEEarlyDepthTest, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEEarlyDepthTest, 0);
// early-exit if no samples passed depth or earlyZ is forced on.
if (state.psState.forceEarlyZ || !_simd_movemask_ps(depthPassMask))
psContext.activeMask = _simd_castps_si(vCoverageMask);
// execute pixel shader
- RDTSC_BEGIN(BEPixelShader, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEPixelShader, pDC->drawId);
state.psState.pfnPixelShader(GetPrivateState(pDC), pWorkerData, &psContext);
- RDTSC_END(BEPixelShader, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEPixelShader, 0);
// update stats
UPDATE_STAT_BE(PsInvocations, _mm_popcnt_u32(_simd_movemask_ps(vCoverageMask)));
// late-Z
if (!T::bCanEarlyZ)
{
- RDTSC_BEGIN(BELateDepthTest, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BELateDepthTest, pDC->drawId);
depthPassMask = DepthStencilTest(&state,
work.triFlags.frontFacing,
work.triFlags.viewportIndex,
AR_EVENT(LateDepthStencilInfoSampleRate(_simd_movemask_ps(depthPassMask),
_simd_movemask_ps(stencilPassMask),
_simd_movemask_ps(vCoverageMask)));
- RDTSC_END(BELateDepthTest, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BELateDepthTest, 0);
if (!_simd_movemask_ps(depthPassMask))
{
UPDATE_STAT_BE(DepthPassCount, statCount);
// output merger
- RDTSC_BEGIN(BEOutputMerger, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEOutputMerger, pDC->drawId);
OutputMerger8x2(pDC,
psContext,
pStencilSample,
stencilPassMask);
}
- RDTSC_END(BEOutputMerger, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEOutputMerger, 0);
}
work.coverageMask[sample] >>= (SIMD_TILE_Y_DIM * SIMD_TILE_X_DIM);
}
Endtile:
ATTR_UNUSED;
- RDTSC_BEGIN(BEEndTile, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEEndTile, pDC->drawId);
if (T::InputCoverage == SWR_INPUT_COVERAGE_INNER_CONSERVATIVE)
{
pStencilBuffer +=
(KNOB_SIMD_WIDTH * FormatTraits<KNOB_STENCIL_HOT_TILE_FORMAT>::bpp) / 8;
- RDTSC_END(BEEndTile, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEEndTile, 0);
psContext.vX.UL = _simd_add_ps(psContext.vX.UL, dx);
psContext.vX.center = _simd_add_ps(psContext.vX.center, dx);
psContext.vY.center = _simd_add_ps(psContext.vY.center, dy);
}
- RDTSC_END(BESampleRateBackend, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BESampleRateBackend, 0);
}
// Recursive template used to auto-nest conditionals. Converts dynamic enum function
SWR_TRIANGLE_DESC& work,
RenderOutputBuffers& renderBuffers)
{
- RDTSC_BEGIN(BESingleSampleBackend, pDC->drawId);
- RDTSC_BEGIN(BESetup, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BESingleSampleBackend, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BESetup, pDC->drawId);
void* pWorkerData = pDC->pContext->threadPool.pThreadData[workerId].pWorkerPrivateData;
state.colorHottileEnable,
renderBuffers);
- RDTSC_END(BESetup, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, BESetup, 1);
psContext.vY.UL = _simd_add_ps(vULOffsetsY, _simd_set1_ps(static_cast<float>(y)));
psContext.vY.center = _simd_add_ps(vCenterOffsetsY, _simd_set1_ps(static_cast<float>(y)));
pCoverageMask, psContext.inputMask, state.blendState.sampleMask);
}
- RDTSC_BEGIN(BEBarycentric, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEBarycentric, pDC->drawId);
CalcPixelBarycentrics(coeffs, psContext);
coeffs.vZa, coeffs.vZb, coeffs.vZc, psContext.vI.center, psContext.vJ.center);
psContext.vZ = state.pfnQuantizeDepth(psContext.vZ);
- RDTSC_END(BEBarycentric, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEBarycentric, 1);
// interpolate user clip distance if available
if (state.backendState.clipDistanceMask)
// Early-Z?
if (T::bCanEarlyZ)
{
- RDTSC_BEGIN(BEEarlyDepthTest, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEEarlyDepthTest, pDC->drawId);
depthPassMask = DepthStencilTest(&state,
work.triFlags.frontFacing,
work.triFlags.viewportIndex,
AR_EVENT(EarlyDepthStencilInfoSingleSample(_simd_movemask_ps(depthPassMask),
_simd_movemask_ps(stencilPassMask),
_simd_movemask_ps(vCoverageMask)));
- RDTSC_END(BEEarlyDepthTest, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEEarlyDepthTest, 0);
// early-exit if no pixels passed depth or earlyZ is forced on
if (state.psState.forceEarlyZ || !_simd_movemask_ps(depthPassMask))
psContext.activeMask = _simd_castps_si(vCoverageMask);
// execute pixel shader
- RDTSC_BEGIN(BEPixelShader, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEPixelShader, pDC->drawId);
state.psState.pfnPixelShader(GetPrivateState(pDC), pWorkerData, &psContext);
- RDTSC_END(BEPixelShader, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEPixelShader, 0);
// update stats
UPDATE_STAT_BE(PsInvocations, _mm_popcnt_u32(_simd_movemask_ps(vCoverageMask)));
// late-Z
if (!T::bCanEarlyZ)
{
- RDTSC_BEGIN(BELateDepthTest, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BELateDepthTest, pDC->drawId);
depthPassMask = DepthStencilTest(&state,
work.triFlags.frontFacing,
work.triFlags.viewportIndex,
AR_EVENT(LateDepthStencilInfoSingleSample(_simd_movemask_ps(depthPassMask),
_simd_movemask_ps(stencilPassMask),
_simd_movemask_ps(vCoverageMask)));
- RDTSC_END(BELateDepthTest, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BELateDepthTest, 0);
if (!_simd_movemask_ps(depthPassMask))
{
UPDATE_STAT_BE(DepthPassCount, statCount);
// output merger
- RDTSC_BEGIN(BEOutputMerger, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEOutputMerger, pDC->drawId);
OutputMerger8x2(pDC,
psContext,
pStencilBuffer,
stencilPassMask);
}
- RDTSC_END(BEOutputMerger, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEOutputMerger, 0);
}
Endtile:
- RDTSC_BEGIN(BEEndTile, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEEndTile, pDC->drawId);
work.coverageMask[0] >>= (SIMD_TILE_Y_DIM * SIMD_TILE_X_DIM);
if (T::InputCoverage == SWR_INPUT_COVERAGE_INNER_CONSERVATIVE)
pStencilBuffer +=
(KNOB_SIMD_WIDTH * FormatTraits<KNOB_STENCIL_HOT_TILE_FORMAT>::bpp) / 8;
- RDTSC_END(BEEndTile, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEEndTile, 0);
psContext.vX.UL = _simd_add_ps(psContext.vX.UL, dx);
psContext.vX.center = _simd_add_ps(psContext.vX.center, dx);
psContext.vY.center = _simd_add_ps(psContext.vY.center, dy);
}
- RDTSC_END(BESingleSampleBackend, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BESingleSampleBackend, 0);
}
// Recursive template used to auto-nest conditionals. Converts dynamic enum function
Integer<SIMD_T> vNegB1 = SIMD_T::mullo_epi32(vBi[1], SIMD_T::set1_epi32(-1));
Integer<SIMD_T> vNegB2 = SIMD_T::mullo_epi32(vBi[2], SIMD_T::set1_epi32(-1));
- RDTSC_EVENT(FEEarlyRastEnter, _mm_popcnt_u32(oneTileMask & triMask), 0);
+ RDTSC_EVENT(pDC->pContext->pBucketMgr,
+ FEEarlyRastEnter,
+ _mm_popcnt_u32(oneTileMask & triMask),
+ 0);
Integer<SIMD_T> vShiftCntrl = EarlyRastHelper<SIMD_T>::InitShiftCntrl();
Integer<SIMD_T> vCwTris = SIMD_T::set1_epi32(cwTrisMask);
if (triMask ^ oldTriMask)
{
- RDTSC_EVENT(FEEarlyRastExit, _mm_popcnt_u32(triMask & oneTileMask), 0);
+ RDTSC_EVENT(pDC->pContext->pBucketMgr,
+ FEEarlyRastExit,
+ _mm_popcnt_u32(triMask & oneTileMask),
+ 0);
}
return triMask;
}
{
const uint32_t* aRTAI = reinterpret_cast<const uint32_t*>(&rtIdx);
- RDTSC_BEGIN(FEBinTriangles, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEBinTriangles, pDC->drawId);
const API_STATE& state = GetApiState(pDC);
const SWR_RASTSTATE& rastState = state.rastState;
if (origTriMask ^ triMask)
{
- RDTSC_EVENT(FECullZeroAreaAndBackface, _mm_popcnt_u32(origTriMask ^ triMask), 0);
+ RDTSC_EVENT(pDC->pContext->pBucketMgr,
+ FECullZeroAreaAndBackface,
+ _mm_popcnt_u32(origTriMask ^ triMask),
+ 0);
}
AR_EVENT(CullInfoEvent(pDC->drawId, cullZeroAreaMask, cullTris, origTriMask));
if (origTriMask ^ triMask)
{
- RDTSC_EVENT(FECullBetweenCenters, _mm_popcnt_u32(origTriMask ^ triMask), 0);
+ RDTSC_EVENT(pDC->pContext->pBucketMgr,
+ FECullBetweenCenters,
+ _mm_popcnt_u32(origTriMask ^ triMask),
+ 0);
}
}
if (!triMask)
{
- RDTSC_END(FEBinTriangles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEBinTriangles, 1);
return;
}
}
if (!triMask)
{
- RDTSC_END(FEBinTriangles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEBinTriangles, 1);
return;
}
BinPostSetupLinesImpl<SIMD_T, SIMD_WIDTH>(
pDC, pa, workerId, line, recipW, triMask, primID, viewportIdx, rtIdx);
- RDTSC_END(FEBinTriangles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEBinTriangles, 1);
return;
}
else if (rastState.fillMode == SWR_FILLMODE_POINT)
BinPostSetupPointsImpl<SIMD_T, SIMD_WIDTH>(
pDC, pa, workerId, &tri[2], triMask, primID, viewportIdx, rtIdx);
- RDTSC_END(FEBinTriangles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEBinTriangles, 1);
return;
}
triMask &= ~(1 << triIndex);
}
- RDTSC_END(FEBinTriangles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEBinTriangles, 1);
}
template <typename CT>
Integer<SIMD_T> const& viewportIdx,
Integer<SIMD_T> const& rtIdx)
{
- RDTSC_BEGIN(FEBinPoints, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEBinPoints, pDC->drawId);
Vec4<SIMD_T>& primVerts = prim[0];
}
}
- RDTSC_END(FEBinPoints, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEBinPoints, 1);
}
//////////////////////////////////////////////////////////////////////////
{
const uint32_t* aRTAI = reinterpret_cast<const uint32_t*>(&rtIdx);
- RDTSC_BEGIN(FEBinLines, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEBinLines, pDC->drawId);
const API_STATE& state = GetApiState(pDC);
const SWR_RASTSTATE& rastState = state.rastState;
endBinLines:
- RDTSC_END(FEBinLines, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEBinLines, 1);
}
//////////////////////////////////////////////////////////////////////////
simdscalari const& viewportIdx,
simdscalari const& rtIdx)
{
- RDTSC_BEGIN(FEClipRectangles, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEClipRectangles, pDC->drawId);
Clipper<SIMD256, 3> clipper(workerId, pDC);
clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
- RDTSC_END(FEClipRectangles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEClipRectangles, 1);
}
void ClipTriangles(DRAW_CONTEXT* pDC,
simdscalari const& viewportIdx,
simdscalari const& rtIdx)
{
- RDTSC_BEGIN(FEClipTriangles, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEClipTriangles, pDC->drawId);
Clipper<SIMD256, 3> clipper(workerId, pDC);
clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
- RDTSC_END(FEClipTriangles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEClipTriangles, 1);
}
void ClipLines(DRAW_CONTEXT* pDC,
simdscalari const& viewportIdx,
simdscalari const& rtIdx)
{
- RDTSC_BEGIN(FEClipLines, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEClipLines, pDC->drawId);
Clipper<SIMD256, 2> clipper(workerId, pDC);
clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
- RDTSC_END(FEClipLines, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEClipLines, 1);
}
void ClipPoints(DRAW_CONTEXT* pDC,
simdscalari const& viewportIdx,
simdscalari const& rtIdx)
{
- RDTSC_BEGIN(FEClipPoints, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEClipPoints, pDC->drawId);
Clipper<SIMD256, 1> clipper(workerId, pDC);
clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
- RDTSC_END(FEClipPoints, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEClipPoints, 1);
}
#if USE_SIMD16_FRONTEND
simd16scalari const& viewportIdx,
simd16scalari const& rtIdx)
{
- RDTSC_BEGIN(FEClipRectangles, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEClipRectangles, pDC->drawId);
enum
{
pa.useAlternateOffset = false;
clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
- RDTSC_END(FEClipRectangles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEClipRectangles, 1);
}
void SIMDCALL ClipTriangles_simd16(DRAW_CONTEXT* pDC,
simd16scalari const& viewportIdx,
simd16scalari const& rtIdx)
{
- RDTSC_BEGIN(FEClipTriangles, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEClipTriangles, pDC->drawId);
enum
{
pa.useAlternateOffset = false;
clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
- RDTSC_END(FEClipTriangles, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEClipTriangles, 1);
}
void SIMDCALL ClipLines_simd16(DRAW_CONTEXT* pDC,
simd16scalari const& viewportIdx,
simd16scalari const& rtIdx)
{
- RDTSC_BEGIN(FEClipLines, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEClipLines, pDC->drawId);
enum
{
pa.useAlternateOffset = false;
clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
- RDTSC_END(FEClipLines, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEClipLines, 1);
}
void SIMDCALL ClipPoints_simd16(DRAW_CONTEXT* pDC,
simd16scalari const& viewportIdx,
simd16scalari const& rtIdx)
{
- RDTSC_BEGIN(FEClipPoints, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEClipPoints, pDC->drawId);
enum
{
pa.useAlternateOffset = false;
clipper.ExecuteStage(pa, prims, primMask, primId, viewportIdx, rtIdx);
- RDTSC_END(FEClipPoints, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEClipPoints, 1);
}
#endif
if (clipMask)
{
- RDTSC_BEGIN(FEGuardbandClip, pa.pDC->drawId);
+ RDTSC_BEGIN(pa.pDC->pContext->pBucketMgr, FEGuardbandClip, pa.pDC->drawId);
// we have to clip tris, execute the clipper, which will also
// call the binner
ClipSimd(prim,
primId,
viewportIdx,
rtIdx);
- RDTSC_END(FEGuardbandClip, 1);
+ RDTSC_END(pa.pDC->pContext->pBucketMgr, FEGuardbandClip, 1);
}
else if (validMask)
{
#include "core/fifo.hpp"
#include "core/knobs.h"
#include "common/intrin.h"
+#include "common/rdtsc_buckets.h"
#include "core/threads.h"
#include "ringbuffer.h"
#include "archrast/archrast.h"
HotTileMgr* pHotTileMgr;
// Callback functions, passed in at create context time
- PFN_LOAD_TILE pfnLoadTile;
- PFN_STORE_TILE pfnStoreTile;
- PFN_TRANSLATE_GFXPTR_FOR_READ pfnTranslateGfxptrForRead;
- PFN_TRANSLATE_GFXPTR_FOR_WRITE pfnTranslateGfxptrForWrite;
- PFN_MAKE_GFXPTR pfnMakeGfxPtr;
- PFN_UPDATE_SO_WRITE_OFFSET pfnUpdateSoWriteOffset;
- PFN_UPDATE_STATS pfnUpdateStats;
- PFN_UPDATE_STATS_FE pfnUpdateStatsFE;
+ PFN_LOAD_TILE pfnLoadTile;
+ PFN_STORE_TILE pfnStoreTile;
+ PFN_TRANSLATE_GFXPTR_FOR_READ pfnTranslateGfxptrForRead;
+ PFN_TRANSLATE_GFXPTR_FOR_WRITE pfnTranslateGfxptrForWrite;
+ PFN_MAKE_GFXPTR pfnMakeGfxPtr;
+ PFN_UPDATE_SO_WRITE_OFFSET pfnUpdateSoWriteOffset;
+ PFN_UPDATE_STATS pfnUpdateStats;
+ PFN_UPDATE_STATS_FE pfnUpdateStatsFE;
// Global Stats
// ArchRast thread contexts.
HANDLE* pArContext;
+
+ BucketManager *pBucketMgr;
};
#define UPDATE_STAT_BE(name, count) \
#define AR_API_CTX pDC->pContext->pArContext[pContext->NumWorkerThreads]
#ifdef KNOB_ENABLE_RDTSC
-#define RDTSC_BEGIN(type, drawid) RDTSC_START(type)
-#define RDTSC_END(type, count) RDTSC_STOP(type, count, 0)
+#define RDTSC_BEGIN(pBucketMgr, type, drawid) RDTSC_START(pBucketMgr, type)
+#define RDTSC_END(pBucketMgr, type, count) RDTSC_STOP(pBucketMgr, type, count, 0)
#else
-#define RDTSC_BEGIN(type, count)
-#define RDTSC_END(type, count)
+#define RDTSC_BEGIN(pBucketMgr, type, drawid)
+#define RDTSC_END(pBucketMgr, type, count)
#endif
#ifdef KNOB_ENABLE_AR
/// @todo This should go away when we switch this to use compute threading.
void ProcessStoreTiles(SWR_CONTEXT* pContext, DRAW_CONTEXT* pDC, uint32_t workerId, void* pUserData)
{
- RDTSC_BEGIN(FEProcessStoreTiles, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, FEProcessStoreTiles, pDC->drawId);
MacroTileMgr* pTileMgr = pDC->pTileMgr;
STORE_TILES_DESC* pDesc = (STORE_TILES_DESC*)pUserData;
}
}
- RDTSC_END(FEProcessStoreTiles, 0);
+ RDTSC_END(pContext->pBucketMgr, FEProcessStoreTiles, 0);
}
//////////////////////////////////////////////////////////////////////////
uint32_t workerId,
void* pUserData)
{
- RDTSC_BEGIN(FEProcessInvalidateTiles, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, FEProcessInvalidateTiles, pDC->drawId);
DISCARD_INVALIDATE_TILES_DESC* pDesc = (DISCARD_INVALIDATE_TILES_DESC*)pUserData;
MacroTileMgr* pTileMgr = pDC->pTileMgr;
}
}
- RDTSC_END(FEProcessInvalidateTiles, 0);
+ RDTSC_END(pContext->pBucketMgr, FEProcessInvalidateTiles, 0);
}
//////////////////////////////////////////////////////////////////////////
static void StreamOut(
DRAW_CONTEXT* pDC, PA_STATE& pa, uint32_t workerId, uint32_t* pPrimData, uint32_t streamIndex)
{
- RDTSC_BEGIN(FEStreamout, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEStreamout, pDC->drawId);
const API_STATE& state = GetApiState(pDC);
const SWR_STREAMOUT_STATE& soState = state.soState;
UPDATE_STAT_FE(SoPrimStorageNeeded[streamIndex], soContext.numPrimStorageNeeded);
UPDATE_STAT_FE(SoNumPrimsWritten[streamIndex], soContext.numPrimsWritten);
- RDTSC_END(FEStreamout, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEStreamout, 1);
}
#if USE_SIMD16_FRONTEND
#endif
simdscalari const& primID)
{
- RDTSC_BEGIN(FEGeometryShader, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEGeometryShader, pDC->drawId);
void* pWorkerData = pDC->pContext->threadPool.pThreadData[workerId].pWorkerPrivateData;
UPDATE_STAT_FE(GsInvocations, numInputPrims * pState->instanceCount);
UPDATE_STAT_FE(GsPrimitives, totalPrimsGenerated);
AR_EVENT(GSPrimInfo(numInputPrims, totalPrimsGenerated, numVertsPerPrim * numInputPrims));
- RDTSC_END(FEGeometryShader, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEGeometryShader, 1);
}
//////////////////////////////////////////////////////////////////////////
hsContext.mask = GenerateMask(numPrims);
// Run the HS
- RDTSC_BEGIN(FEHullShader, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEHullShader, pDC->drawId);
state.pfnHsFunc(GetPrivateState(pDC), pWorkerData, &hsContext);
- RDTSC_END(FEHullShader, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEHullShader, 0);
UPDATE_STAT_FE(HsInvocations, numPrims);
AR_EVENT(HSStats((HANDLE)&hsContext.stats));
{
// Run Tessellator
SWR_TS_TESSELLATED_DATA tsData = {0};
- RDTSC_BEGIN(FETessellation, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FETessellation, pDC->drawId);
TSTessellate(tsCtx, hsContext.pCPout[p].tessFactors, tsData);
AR_EVENT(TessPrimCount(1));
- RDTSC_END(FETessellation, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, FETessellation, 0);
if (tsData.NumPrimitives == 0)
{
{
dsContext.mask = GenerateMask(tsData.NumDomainPoints - dsInvocations);
- RDTSC_BEGIN(FEDomainShader, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEDomainShader, pDC->drawId);
state.pfnDsFunc(GetPrivateState(pDC), pWorkerData, &dsContext);
- RDTSC_END(FEDomainShader, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEDomainShader, 0);
AR_EVENT(DSStats((HANDLE)&dsContext.stats));
#else
simdvector prim[3]; // Only deal with triangles, lines, or points
#endif
- RDTSC_BEGIN(FEPAAssemble, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, FEPAAssemble, pDC->drawId);
bool assemble =
#if USE_SIMD16_FRONTEND
tessPa.Assemble(VERTEX_POSITION_SLOT, prim_simd16);
#else
tessPa.Assemble(VERTEX_POSITION_SLOT, prim);
#endif
- RDTSC_END(FEPAAssemble, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, FEPAAssemble, 1);
SWR_ASSERT(assemble);
SWR_ASSERT(pfnClipFunc);
}
#endif
- RDTSC_BEGIN(FEProcessDraw, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, FEProcessDraw, pDC->drawId);
void* pWorkerData = pContext->threadPool.pThreadData[workerId].pWorkerPrivateData;
#endif
}
// 1. Execute FS/VS for a single SIMD.
- RDTSC_BEGIN(FEFetchShader, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, FEFetchShader, pDC->drawId);
#if USE_SIMD16_SHADERS
state.pfnFetchFunc(GetPrivateState(pDC), pWorkerData, fetchInfo_lo, vin);
#else
state.pfnFetchFunc(GetPrivateState(pDC), pWorkerData, fetchInfo_hi, vin_hi);
}
#endif
- RDTSC_END(FEFetchShader, 0);
+ RDTSC_END(pContext->pBucketMgr, FEFetchShader, 0);
// forward fetch generated vertex IDs to the vertex shader
#if USE_SIMD16_SHADERS
if (!KNOB_TOSS_FETCH)
#endif
{
- RDTSC_BEGIN(FEVertexShader, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, FEVertexShader, pDC->drawId);
#if USE_SIMD16_VS
state.pfnVertexFunc(GetPrivateState(pDC), pWorkerData, &vsContext_lo);
AR_EVENT(VSStats((HANDLE)&vsContext_lo.stats));
AR_EVENT(VSStats((HANDLE)&vsContext_hi.stats));
}
#endif
- RDTSC_END(FEVertexShader, 0);
+ RDTSC_END(pContext->pBucketMgr, FEVertexShader, 0);
UPDATE_STAT_FE(VsInvocations, GetNumInvocations(i, endVertex));
}
{
simd16vector prim_simd16[MAX_NUM_VERTS_PER_PRIM];
- RDTSC_START(FEPAAssemble);
+ RDTSC_START(pContext->pBucketMgr, FEPAAssemble);
bool assemble = pa.Assemble(VERTEX_POSITION_SLOT, prim_simd16);
- RDTSC_STOP(FEPAAssemble, 1, 0);
+ RDTSC_STOP(pContext->pBucketMgr, FEPAAssemble, 1, 0);
#if KNOB_ENABLE_TOSS_POINTS
if (!KNOB_TOSS_FETCH)
if (i < endVertex)
{
// 1. Execute FS/VS for a single SIMD.
- RDTSC_BEGIN(FEFetchShader, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, FEFetchShader, pDC->drawId);
state.pfnFetchFunc(GetPrivateState(pDC), pWorkerData, fetchInfo, vout);
- RDTSC_END(FEFetchShader, 0);
+ RDTSC_END(pContext->pBucketMgr, FEFetchShader, 0);
// forward fetch generated vertex IDs to the vertex shader
vsContext.VertexID = fetchInfo.VertexID;
if (!KNOB_TOSS_FETCH)
#endif
{
- RDTSC_BEGIN(FEVertexShader, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, FEVertexShader, pDC->drawId);
state.pfnVertexFunc(GetPrivateState(pDC), pWorkerData, &vsContext);
- RDTSC_END(FEVertexShader, 0);
+ RDTSC_END(pContext->pBucketMgr, FEVertexShader, 0);
UPDATE_STAT_FE(VsInvocations, GetNumInvocations(i, endVertex));
AR_EVENT(VSStats((HANDLE)&vsContext.stats));
{
simdvector prim[MAX_NUM_VERTS_PER_PRIM];
// PaAssemble returns false if there is not enough verts to assemble.
- RDTSC_BEGIN(FEPAAssemble, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, FEPAAssemble, pDC->drawId);
bool assemble = pa.Assemble(VERTEX_POSITION_SLOT, prim);
- RDTSC_END(FEPAAssemble, 1);
+ RDTSC_END(pContext->pBucketMgr, FEPAAssemble, 1);
#if KNOB_ENABLE_TOSS_POINTS
if (!KNOB_TOSS_FETCH)
#endif
- RDTSC_END(FEProcessDraw, numPrims * work.numInstances);
+ RDTSC_END(pContext->pBucketMgr, FEProcessDraw, numPrims * work.numInstances);
}
struct FEDrawChooser
#endif
// bloat line to two tris and call the triangle rasterizer twice
- RDTSC_BEGIN(BERasterizeLine, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BERasterizeLine, pDC->drawId);
const API_STATE& state = GetApiState(pDC);
const SWR_RASTSTATE& rastState = state.rastState;
pfnTriRast(pDC, workerId, macroTile, (void*)&newWorkDesc);
}
- RDTSC_BEGIN(BERasterizeLine, 1);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BERasterizeLine, 1);
}
void RasterizeSimplePoint(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pData)
renderBuffers,
triDesc.triFlags.renderTargetArrayIndex);
- RDTSC_BEGIN(BEPixelBackend, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEPixelBackend, pDC->drawId);
backendFuncs.pfnBackend(pDC, workerId, tileAlignedX, tileAlignedY, triDesc, renderBuffers);
- RDTSC_END(BEPixelBackend, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEPixelBackend, 0);
}
void RasterizeTriPoint(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t macroTile, void* pData)
}
// not trivial accept or reject, must rasterize full tile
- RDTSC_BEGIN(BERasterizePartial, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BERasterizePartial, pDC->drawId);
innerCoverageMask = rasterizePartialTile<RT::NumEdgesT::value, typename RT::ValidEdgeMaskT>(
pDC, startQuadEdgesAdj, pRastEdges);
- RDTSC_END(BERasterizePartial, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BERasterizePartial, 0);
}
};
return;
}
#endif
- RDTSC_BEGIN(BERasterizeTriangle, pDC->drawId);
- RDTSC_BEGIN(BETriangleSetup, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BERasterizeTriangle, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BETriangleSetup, pDC->drawId);
const API_STATE& state = GetApiState(pDC);
const SWR_RASTSTATE& rastState = state.rastState;
intersect.xmin >= 0 && intersect.xmax >= 0 && intersect.ymin >= 0 &&
intersect.ymax >= 0);
- RDTSC_END(BETriangleSetup, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BETriangleSetup, 0);
// update triangle desc
uint32_t minTileX = intersect.xmin >> (KNOB_TILE_X_DIM_SHIFT + FIXED_POINT_SHIFT);
if (numTilesX == 0 || numTilesY == 0)
{
- RDTSC_EVENT(BEEmptyTriangle, 1, 0);
- RDTSC_END(BERasterizeTriangle, 1);
+ RDTSC_EVENT(pDC->pContext->pBucketMgr, BEEmptyTriangle, 1, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BERasterizeTriangle, 1);
return;
}
- RDTSC_BEGIN(BEStepSetup, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEStepSetup, pDC->drawId);
// Step to pixel center of top-left pixel of the triangle bbox
// Align intersect bbox (top/left) to raster tile's (top/left).
}
}
- RDTSC_END(BEStepSetup, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEStepSetup, 0);
uint32_t tY = minTileY;
uint32_t tX = minTileX;
{
triDesc.innerCoverageMask = 0xffffffffffffffffULL;
}
- RDTSC_EVENT(BETrivialAccept, 1, 0);
+ RDTSC_EVENT(pDC->pContext->pBucketMgr, BETrivialAccept, 1, 0);
}
else
{
}
// not trivial accept or reject, must rasterize full tile
- RDTSC_BEGIN(BERasterizePartial, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BERasterizePartial, pDC->drawId);
triDesc.coverageMask[sampleNum] =
rasterizePartialTile<RT::NumEdgesT::value, typename RT::ValidEdgeMaskT>(
pDC, startQuadEdges, rastEdges);
- RDTSC_END(BERasterizePartial, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BERasterizePartial, 0);
triDesc.anyCoveredSamples |= triDesc.coverageMask[sampleNum];
{
triDesc.coverageMask[sampleNum] = 0;
}
- RDTSC_EVENT(BETrivialReject, 1, 0);
+ RDTSC_EVENT(pDC->pContext->pBucketMgr, BETrivialReject, 1, 0);
}
}
// Track rasterized subspans
AR_EVENT(RasterTileCount(pDC->drawId, 1));
- RDTSC_BEGIN(BEPixelBackend, pDC->drawId);
+ RDTSC_BEGIN(pDC->pContext->pBucketMgr, BEPixelBackend, pDC->drawId);
backendFuncs.pfnBackend(pDC,
workerId,
tileX << KNOB_TILE_X_DIM_SHIFT,
tileY << KNOB_TILE_Y_DIM_SHIFT,
triDesc,
renderBuffers);
- RDTSC_END(BEPixelBackend, 0);
+ RDTSC_END(pDC->pContext->pBucketMgr, BEPixelBackend, 0);
}
// step to the next tile in X
StepRasterTileY<RT>(state.colorHottileEnable, renderBuffers, currentRenderBufferRow);
}
- RDTSC_END(BERasterizeTriangle, 1);
+ RDTSC_END(pDC->pContext->pBucketMgr, BERasterizeTriangle, 1);
}
// Get pointers to hot tile memory for color RT, depth, stencil
static_assert(NumBuckets == (sizeof(gCoreBuckets) / sizeof(gCoreBuckets[0])),
"RDTSC Bucket enum and description table size mismatched.");
-/// @todo bucketmanager and mapping should probably be a part of the SWR context
-std::vector<uint32_t> gBucketMap;
-BucketManager gBucketMgr;
-
-uint32_t gCurrentFrame = 0;
-bool gBucketsInitialized = false;
NumBuckets
};
-void rdtscReset();
-void rdtscInit(int threadId);
-void rdtscStart(uint32_t bucketId);
-void rdtscStop(uint32_t bucketId, uint32_t count, uint64_t drawId);
-void rdtscEvent(uint32_t bucketId, uint32_t count1, uint32_t count2);
-void rdtscEndFrame();
+void rdtscReset(BucketManager* pBucketMgr);
+void rdtscInit(BucketManager* pBucketMgr, int threadId);
+void rdtscStart(BucketManager* pBucketMgr, uint32_t bucketId);
+void rdtscStop(BucketManager* pBucketMgr, uint32_t bucketId, uint32_t count, uint64_t drawId);
+void rdtscEvent(BucketManager* pBucketMgr, uint32_t bucketId, uint32_t count1, uint32_t count2);
+void rdtscEndFrame(BucketManager* pBucketMgr);
#ifdef KNOB_ENABLE_RDTSC
-#define RDTSC_RESET() rdtscReset()
-#define RDTSC_INIT(threadId) rdtscInit(threadId)
-#define RDTSC_START(bucket) rdtscStart(bucket)
-#define RDTSC_STOP(bucket, count, draw) rdtscStop(bucket, count, draw)
-#define RDTSC_EVENT(bucket, count1, count2) rdtscEvent(bucket, count1, count2)
-#define RDTSC_ENDFRAME() rdtscEndFrame()
+#define RDTSC_RESET(pBucketMgr) rdtscReset(pBucketMgr)
+#define RDTSC_INIT(pBucketMgr, threadId) rdtscInit(pBucketMgr,threadId)
+#define RDTSC_START(pBucketMgr, bucket) rdtscStart(pBucketMgr, bucket)
+#define RDTSC_STOP(pBucketMgr, bucket, count, draw) rdtscStop(pBucketMgr, bucket, count, draw)
+#define RDTSC_EVENT(pBucketMgr, bucket, count1, count2) rdtscEvent(pBucketMgr, bucket, count1, count2)
+#define RDTSC_ENDFRAME(pBucketMgr) rdtscEndFrame(pBucketMgr)
#else
-#define RDTSC_RESET()
-#define RDTSC_INIT(threadId)
-#define RDTSC_START(bucket)
-#define RDTSC_STOP(bucket, count, draw)
-#define RDTSC_EVENT(bucket, count1, count2)
-#define RDTSC_ENDFRAME()
+#define RDTSC_RESET(pBucketMgr)
+#define RDTSC_INIT(pBucketMgr, threadId)
+#define RDTSC_START(pBucketMgr, bucket)
+#define RDTSC_STOP(pBucketMgr, bucket, count, draw)
+#define RDTSC_EVENT(pBucketMgr, bucket, count1, count2)
+#define RDTSC_ENDFRAME(pBucketMgr)
#endif
-extern std::vector<uint32_t> gBucketMap;
-extern BucketManager gBucketMgr;
extern BUCKET_DESC gCoreBuckets[];
-extern uint32_t gCurrentFrame;
-extern bool gBucketsInitialized;
-INLINE void rdtscReset()
+INLINE void rdtscReset(BucketManager *pBucketMgr)
{
- gCurrentFrame = 0;
- gBucketMgr.ClearThreads();
+ pBucketMgr->mCurrentFrame = 0;
+ pBucketMgr->ClearThreads();
}
-INLINE void rdtscInit(int threadId)
+INLINE void rdtscInit(BucketManager* pBucketMgr, int threadId)
{
// register all the buckets once
- if (!gBucketsInitialized && (threadId == 0))
+ if (!pBucketMgr->mBucketsInitialized && (threadId == 0))
{
- gBucketMap.resize(NumBuckets);
+ pBucketMgr->mBucketMap.resize(NumBuckets);
for (uint32_t i = 0; i < NumBuckets; ++i)
{
- gBucketMap[i] = gBucketMgr.RegisterBucket(gCoreBuckets[i]);
+ pBucketMgr->mBucketMap[i] = pBucketMgr->RegisterBucket(gCoreBuckets[i]);
}
- gBucketsInitialized = true;
+ pBucketMgr->mBucketsInitialized = true;
}
std::string name = threadId == 0 ? "API" : "WORKER";
- gBucketMgr.RegisterThread(name);
+ pBucketMgr->RegisterThread(name);
}
-INLINE void rdtscStart(uint32_t bucketId)
+INLINE void rdtscStart(BucketManager* pBucketMgr, uint32_t bucketId)
{
- uint32_t id = gBucketMap[bucketId];
- gBucketMgr.StartBucket(id);
+ uint32_t id = pBucketMgr->mBucketMap[bucketId];
+ pBucketMgr->StartBucket(id);
}
-INLINE void rdtscStop(uint32_t bucketId, uint32_t count, uint64_t drawId)
+INLINE void rdtscStop(BucketManager* pBucketMgr, uint32_t bucketId, uint32_t count, uint64_t drawId)
{
- uint32_t id = gBucketMap[bucketId];
- gBucketMgr.StopBucket(id);
+ uint32_t id = pBucketMgr->mBucketMap[bucketId];
+ pBucketMgr->StopBucket(id);
}
-INLINE void rdtscEvent(uint32_t bucketId, uint32_t count1, uint32_t count2)
+INLINE void rdtscEvent(BucketManager* pBucketMgr, uint32_t bucketId, uint32_t count1, uint32_t count2)
{
- uint32_t id = gBucketMap[bucketId];
- gBucketMgr.AddEvent(id, count1);
+ uint32_t id = pBucketMgr->mBucketMap[bucketId];
+ pBucketMgr->AddEvent(id, count1);
}
-INLINE void rdtscEndFrame()
+INLINE void rdtscEndFrame(BucketManager* pBucketMgr)
{
- gCurrentFrame++;
+ pBucketMgr->mCurrentFrame++;
- if (gCurrentFrame == KNOB_BUCKETS_START_FRAME &&
+ if (pBucketMgr->mCurrentFrame == KNOB_BUCKETS_START_FRAME &&
KNOB_BUCKETS_START_FRAME < KNOB_BUCKETS_END_FRAME)
{
- gBucketMgr.StartCapture();
+ pBucketMgr->StartCapture();
}
- if (gCurrentFrame == KNOB_BUCKETS_END_FRAME &&
+ if (pBucketMgr->mCurrentFrame == KNOB_BUCKETS_END_FRAME &&
KNOB_BUCKETS_START_FRAME < KNOB_BUCKETS_END_FRAME)
{
- gBucketMgr.StopCapture();
- gBucketMgr.PrintReport("rdtsc.txt");
+ pBucketMgr->StopCapture();
+ pBucketMgr->PrintReport("rdtsc.txt");
}
}
#include "common/formats.h"
#include "common/intrin.h"
+#include "common/rdtsc_buckets.h"
#include <functional>
#include <algorithm>
uint8_t* pColorBuffer[SWR_NUM_RENDERTARGETS]; // IN: Pointers to render target hottiles
SWR_SHADER_STATS stats; // OUT: shader statistics used for archrast.
+
+ BucketManager *pBucketManager; // @llvm_struct - IN: performance buckets.
};
//////////////////////////////////////////////////////////////////////////
{
BE_WORK* pWork;
- RDTSC_BEGIN(WorkerFoundWork, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, WorkerFoundWork, pDC->drawId);
uint32_t numWorkItems = tile->getNumQueued();
SWR_ASSERT(numWorkItems);
pWork->pfnWork(pDC, workerId, tileID, &pWork->desc);
tile->dequeue();
}
- RDTSC_END(WorkerFoundWork, numWorkItems);
+ RDTSC_END(pContext->pBucketMgr, WorkerFoundWork, numWorkItems);
_ReadWriteBarrier();
SetCurrentThreadName(threadName);
}
- RDTSC_INIT(threadId);
+ RDTSC_INIT(pContext->pBucketMgr, threadId);
// Only need offset numa index from base for correct masking
uint32_t numaNode = pThreadData->numaId - pContext->threadInfo.BASE_NUMA_NODE;
if (IsBEThread)
{
- RDTSC_BEGIN(WorkerWorkOnFifoBE, 0);
+ RDTSC_BEGIN(pContext->pBucketMgr, WorkerWorkOnFifoBE, 0);
bShutdown |=
WorkOnFifoBE(pContext, workerId, curDrawBE, lockedTiles, numaNode, numaMask);
- RDTSC_END(WorkerWorkOnFifoBE, 0);
+ RDTSC_END(pContext->pBucketMgr, WorkerWorkOnFifoBE, 0);
WorkOnCompute(pContext, workerId, curDrawBE);
}
if (pHotTile->state == HOTTILE_INVALID)
{
- RDTSC_BEGIN(BELoadTiles, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, BELoadTiles, pDC->drawId);
// invalid hottile before draw requires a load from surface before we can draw to it
pContext->pfnLoadTile(GetPrivateState(pDC),
hWorkerPrivateData,
pHotTile->renderTargetArrayIndex,
pHotTile->pBuffer);
pHotTile->state = HOTTILE_DIRTY;
- RDTSC_END(BELoadTiles, 0);
+ RDTSC_END(pContext->pBucketMgr, BELoadTiles, 0);
}
else if (pHotTile->state == HOTTILE_CLEAR)
{
- RDTSC_BEGIN(BELoadTiles, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, BELoadTiles, pDC->drawId);
// Clear the tile.
ClearColorHotTile(pHotTile);
pHotTile->state = HOTTILE_DIRTY;
- RDTSC_END(BELoadTiles, 0);
+ RDTSC_END(pContext->pBucketMgr, BELoadTiles, 0);
}
colorHottileEnableMask &= ~(1 << rtSlot);
}
pContext, pDC, hWorkerPrivateData, macroID, SWR_ATTACHMENT_DEPTH, true, numSamples);
if (pHotTile->state == HOTTILE_INVALID)
{
- RDTSC_BEGIN(BELoadTiles, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, BELoadTiles, pDC->drawId);
// invalid hottile before draw requires a load from surface before we can draw to it
pContext->pfnLoadTile(GetPrivateState(pDC),
hWorkerPrivateData,
pHotTile->renderTargetArrayIndex,
pHotTile->pBuffer);
pHotTile->state = HOTTILE_DIRTY;
- RDTSC_END(BELoadTiles, 0);
+ RDTSC_END(pContext->pBucketMgr, BELoadTiles, 0);
}
else if (pHotTile->state == HOTTILE_CLEAR)
{
- RDTSC_BEGIN(BELoadTiles, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, BELoadTiles, pDC->drawId);
// Clear the tile.
ClearDepthHotTile(pHotTile);
pHotTile->state = HOTTILE_DIRTY;
- RDTSC_END(BELoadTiles, 0);
+ RDTSC_END(pContext->pBucketMgr, BELoadTiles, 0);
}
}
pContext, pDC, hWorkerPrivateData, macroID, SWR_ATTACHMENT_STENCIL, true, numSamples);
if (pHotTile->state == HOTTILE_INVALID)
{
- RDTSC_BEGIN(BELoadTiles, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, BELoadTiles, pDC->drawId);
// invalid hottile before draw requires a load from surface before we can draw to it
pContext->pfnLoadTile(GetPrivateState(pDC),
hWorkerPrivateData,
pHotTile->renderTargetArrayIndex,
pHotTile->pBuffer);
pHotTile->state = HOTTILE_DIRTY;
- RDTSC_END(BELoadTiles, 0);
+ RDTSC_END(pContext->pBucketMgr, BELoadTiles, 0);
}
else if (pHotTile->state == HOTTILE_CLEAR)
{
- RDTSC_BEGIN(BELoadTiles, pDC->drawId);
+ RDTSC_BEGIN(pContext->pBucketMgr, BELoadTiles, pDC->drawId);
// Clear the tile.
ClearStencilHotTile(pHotTile);
pHotTile->state = HOTTILE_DIRTY;
- RDTSC_END(BELoadTiles, 0);
+ RDTSC_END(pContext->pBucketMgr, BELoadTiles, 0);
}
}
}
ctx->max_draws_in_flight = KNOB_MAX_DRAWS_IN_FLIGHT;
- SWR_CREATECONTEXT_INFO createInfo;
- memset(&createInfo, 0, sizeof(createInfo));
+ SWR_CREATECONTEXT_INFO createInfo {0};
+
createInfo.privateStateSize = sizeof(swr_draw_context);
createInfo.pfnLoadTile = swr_LoadHotTile;
createInfo.pfnStoreTile = swr_StoreHotTile;