diff options
| author | Pringo <Pringo@users.noreply.github.com> | 2014-11-24 21:54:15 -0800 |
|---|---|---|
| committer | Pringo <Pringo@users.noreply.github.com> | 2014-11-24 21:54:15 -0800 |
| commit | 670d94967a64b6a3e99127caf5511b07825f21cb (patch) | |
| tree | e83e2909a2db5dbe8387a40f3839d27abf588c0c /Source/Core/VideoCommon/MainBase.cpp | |
| parent | 5a89ba20d75b17b1aeec090544934b95bdb0ec74 (diff) | |
| parent | 245ff601b7033f4122b48d837171c21baa9ac306 (diff) | |
Merge pull request #1 from dolphin-emu/master
update
Diffstat (limited to 'Source/Core/VideoCommon/MainBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/MainBase.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp index d775cfe64c..40d2f57f20 100644 --- a/Source/Core/VideoCommon/MainBase.cpp +++ b/Source/Core/VideoCommon/MainBase.cpp @@ -1,6 +1,7 @@ #include "Common/Event.h" #include "Core/ConfigManager.h" +#include "VideoCommon/BoundingBox.h" #include "VideoCommon/BPStructs.h" #include "VideoCommon/CommandProcessor.h" #include "VideoCommon/Fifo.h" @@ -25,6 +26,11 @@ static Common::Event s_efbAccessReadyEvent; 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; @@ -217,6 +223,39 @@ u32 VideoBackendHardware::Video_GetQueryResult(PerfQueryType type) return g_perf_query->GetQueryResult(type); } +u16 VideoBackendHardware::Video_GetBoundingBox(int index) +{ + if (!g_ActiveConfig.backend_info.bSupportsBBox) + return BoundingBox::coords[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); + } +} + +static void VideoFifo_CheckBBoxRequest() +{ + if (s_BBoxRequested.IsSet()) + { + s_BBoxResult = g_renderer->BBoxRead(s_BBoxIndex); + s_BBoxRequested.Clear(); + s_BBoxReadyEvent.Set(); + } +} + void VideoBackendHardware::InitializeShared() { VideoCommon_Init(); @@ -292,6 +331,7 @@ void VideoFifo_CheckAsyncRequest() VideoFifo_CheckSwapRequest(); VideoFifo_CheckEFBAccess(); VideoFifo_CheckPerfQueryRequest(); + VideoFifo_CheckBBoxRequest(); } void VideoBackendHardware::Video_GatherPipeBursted() |
