MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / DequeuePresentEvents

Method DequeuePresentEvents

PresentData/PresentMonTraceConsumer.cpp:3474–3493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3472}
3473
3474void PMTraceConsumer::DequeuePresentEvents(std::vector<std::shared_ptr<PresentEvent>>& outPresentEvents)
3475{
3476 outPresentEvents.clear();
3477 {
3478 std::lock_guard<std::mutex> lock(mPresentEventMutex);
3479 if (mReadyCount > 0) {
3480 outPresentEvents.resize(mReadyCount, nullptr);
3481 for (uint32_t i = 0; i < mReadyCount; ++i) {
3482 std::swap(outPresentEvents[i], mCompletedPresents[mCompletedIndex]);
3483 mCompletedIndex = GetRingIndex(mCompletedIndex + 1);
3484 }
3485
3486 mCompletedCount -= mReadyCount;
3487 mReadyCount = 0;
3488 }
3489 }
3490 if (!mIsRealtimeSession && !mDisableOfflineBackpressure) {
3491 mCompletedRingCondition.notify_one();
3492 }
3493}
3494
3495void PMTraceConsumer::SetProviderToggleMode(bool enabled) {
3496 mProviderToggleMode.store(enabled, std::memory_order_release);

Callers 3

OutputFunction · 0.80
DequeueAnalyzedInfoMethod · 0.80
DequeueAnalyzedInfoMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected