summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2015-01-31 12:43:58 +0100
committerdegasus <wickmarkus@web.de>2015-02-22 08:41:15 +0100
commitedbd4021014cd24a7aa98396160df12b590529f7 (patch)
tree828ca5e070e7beef8c9a224396debea2f60328b9 /Source/Core/VideoCommon
parentad7264da7de4ca20472dfc2ef911314ff0e78de7 (diff)
VideoCommon: bbox by async events
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/AsyncRequests.cpp3
-rw-r--r--Source/Core/VideoCommon/AsyncRequests.h7
-rw-r--r--Source/Core/VideoCommon/MainBase.cpp37
3 files changed, 18 insertions, 29 deletions
diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp
index 9430d390fa..e99b1ab255 100644
--- a/Source/Core/VideoCommon/AsyncRequests.cpp
+++ b/Source/Core/VideoCommon/AsyncRequests.cpp
@@ -95,6 +95,9 @@ void AsyncRequests::HandleEvent(const AsyncRequests::Event& e)
Renderer::Swap(e.swap_event.xfbAddr, e.swap_event.fbWidth, e.swap_event.fbStride, e.swap_event.fbHeight, rc);
break;
+ case Event::BBOX_READ:
+ *e.bbox.data = g_renderer->BBoxRead(e.bbox.index);
+
}
}
diff --git a/Source/Core/VideoCommon/AsyncRequests.h b/Source/Core/VideoCommon/AsyncRequests.h
index fe3d5c3234..15cc5c72e8 100644
--- a/Source/Core/VideoCommon/AsyncRequests.h
+++ b/Source/Core/VideoCommon/AsyncRequests.h
@@ -23,6 +23,7 @@ public:
EFB_PEEK_COLOR,
EFB_PEEK_Z,
SWAP_EVENT,
+ BBOX_READ,
} type;
u64 time;
@@ -49,6 +50,12 @@ public:
u32 fbStride;
u32 fbHeight;
} swap_event;
+
+ struct
+ {
+ int index;
+ u16* data;
+ } bbox;
};
};
diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp
index 25741ea7d8..74a2cc5fcf 100644
--- a/Source/Core/VideoCommon/MainBase.cpp
+++ b/Source/Core/VideoCommon/MainBase.cpp
@@ -24,11 +24,6 @@ static Common::Flag s_FifoShuttingDown;
static Common::Flag s_perfQueryRequested;
static Common::Event s_perfQueryReadyEvent;
-static Common::Flag s_BBoxRequested;
-static Common::Event s_BBoxReadyEvent;
-static int s_BBoxIndex;
-static u16 s_BBoxResult;
-
static volatile struct
{
u32 xfbAddr;
@@ -184,30 +179,15 @@ u16 VideoBackendHardware::Video_GetBoundingBox(int index)
SyncGPU(SYNC_GPU_BBOX);
- if (SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread)
- {
- s_BBoxReadyEvent.Reset();
- if (s_FifoShuttingDown.IsSet())
- return 0;
- s_BBoxIndex = index;
- s_BBoxRequested.Set();
- s_BBoxReadyEvent.Wait();
- return s_BBoxResult;
- }
- else
- {
- return g_renderer->BBoxRead(index);
- }
-}
+ AsyncRequests::Event e;
+ u16 result;
+ e.time = 0;
+ e.type = AsyncRequests::Event::BBOX_READ;
+ e.bbox.index = index;
+ e.bbox.data = &result;
+ AsyncRequests::GetInstance()->PushEvent(e, true);
-static void VideoFifo_CheckBBoxRequest()
-{
- if (s_BBoxRequested.IsSet())
- {
- s_BBoxResult = g_renderer->BBoxRead(s_BBoxIndex);
- s_BBoxRequested.Clear();
- s_BBoxReadyEvent.Set();
- }
+ return result;
}
void VideoBackendHardware::InitializeShared()
@@ -275,7 +255,6 @@ void VideoBackendHardware::RunLoop(bool enable)
void VideoFifo_CheckAsyncRequest()
{
VideoFifo_CheckPerfQueryRequest();
- VideoFifo_CheckBBoxRequest();
}
void VideoBackendHardware::Video_GatherPipeBursted()