Files
dolphin/Source/Core/VideoCommon/AsyncRequests.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1015 B
C++
Raw Permalink Normal View History

2015-05-24 06:32:32 +02:00
// Copyright 2015 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2015-05-24 06:32:32 +02:00
2021-12-09 18:22:16 -08:00
#include "VideoCommon/AsyncRequests.h"
#include "Core/System.h"
#include "VideoCommon/Fifo.h"
#include "VideoCommon/VertexManagerBase.h"
#include "VideoCommon/VideoBackendBase.h"
2023-01-30 23:59:54 +13:00
#include "VideoCommon/VideoEvents.h"
AsyncRequests AsyncRequests::s_singleton;
AsyncRequests::AsyncRequests() = default;
void AsyncRequests::PullEvents()
{
if (m_queue.Empty())
return;
// This is only called if the queue isn't empty.
// So just flush the pipeline to get accurate results.
g_vertex_manager->Flush();
while (!m_queue.Empty())
{
std::invoke(std::move(m_queue.Front()));
m_queue.Pop();
}
}
void AsyncRequests::QueueEvent(Event&& event)
{
m_queue.Push(std::move(event));
auto& system = Core::System::GetInstance();
system.GetFifo().RunGpu();
}
void AsyncRequests::WaitForEmptyQueue()
{
m_queue.WaitForEmpty();
}
void AsyncRequests::SetPassthrough(bool enable)
{
m_passthrough = enable;
}