summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/AsyncRequests.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2015-01-31 12:01:01 +0100
committerdegasus <wickmarkus@web.de>2015-02-22 08:41:15 +0100
commitad7264da7de4ca20472dfc2ef911314ff0e78de7 (patch)
treecdf4c362d4b3eaa271c590ccc69074b29187fe74 /Source/Core/VideoCommon/AsyncRequests.cpp
parentbc248f8941ae5f24e651d5bf029740bc96c3df89 (diff)
VideoCommon: implement swap requests in the full async way
Diffstat (limited to 'Source/Core/VideoCommon/AsyncRequests.cpp')
-rw-r--r--Source/Core/VideoCommon/AsyncRequests.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp
index dce56c0d7b..9430d390fa 100644
--- a/Source/Core/VideoCommon/AsyncRequests.cpp
+++ b/Source/Core/VideoCommon/AsyncRequests.cpp
@@ -4,7 +4,7 @@
AsyncRequests AsyncRequests::s_singleton;
AsyncRequests::AsyncRequests()
-: m_enable(false)
+: m_enable(false), m_passthrough(true)
{
}
@@ -34,6 +34,13 @@ void AsyncRequests::PullEventsInternal()
void AsyncRequests::PushEvent(const AsyncRequests::Event& event, bool blocking)
{
std::unique_lock<std::mutex> lock(m_mutex);
+
+ if (m_passthrough)
+ {
+ HandleEvent(event);
+ return;
+ }
+
m_empty.store(false);
m_wake_me_up_again |= blocking;
@@ -65,6 +72,7 @@ void AsyncRequests::SetEnable(bool enable)
void AsyncRequests::HandleEvent(const AsyncRequests::Event& e)
{
+ EFBRectangle rc;
switch (e.type)
{
case Event::EFB_POKE_COLOR:
@@ -83,6 +91,16 @@ void AsyncRequests::HandleEvent(const AsyncRequests::Event& e)
*e.efb_peek.data = g_renderer->AccessEFB(PEEK_Z, e.efb_peek.x, e.efb_peek.y, 0);
break;
+ case Event::SWAP_EVENT:
+ Renderer::Swap(e.swap_event.xfbAddr, e.swap_event.fbWidth, e.swap_event.fbStride, e.swap_event.fbHeight, rc);
+ break;
+
}
}
+void AsyncRequests::SetPassthrough(bool enable)
+{
+ std::unique_lock<std::mutex> lock(m_mutex);
+ m_passthrough = enable;
+}
+