From eb310cbd1d93e1c0c7c94e2571e578aef7a04128 Mon Sep 17 00:00:00 2001 From: degasus Date: Thu, 9 Jan 2014 18:37:59 +0100 Subject: [PATCH] VideoCommon: disable efb access + perf querys on cph thread The usual way to handle this kind of request is to rise a flag which the gpu thread polls. The gpu thread itself either generates the result or just write zeros if disabled. After this, it rise another flag which says that this work is done. So if disabled, we still have the cpu-gpu round trip time. This commit just returns 0 on the cpu thread instead of playing ping pong... --- Source/Core/VideoBackends/D3D/Render.cpp | 3 --- Source/Core/VideoBackends/OGL/Render.cpp | 3 --- Source/Core/VideoCommon/MainBase.cpp | 7 ++++++- Source/Core/VideoCommon/PerfQueryBase.h | 1 + 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 5d2df67e5f..52448e4f3f 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -343,9 +343,6 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) D3D11_MAPPED_SUBRESOURCE map; ID3D11Texture2D* read_tex; - if (!g_ActiveConfig.bEFBAccessEnable) - return 0; - if (type == POKE_Z) { static bool alert_only_once = true; diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 52848042db..fe1a94f0ec 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -968,9 +968,6 @@ void Renderer::UpdateEFBCache(EFBAccessType type, u32 cacheRectIdx, const EFBRec // - GX_PokeZMode (TODO) u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) { - if (!g_ActiveConfig.bEFBAccessEnable) - return 0; - u32 cacheRectIdx = (y / EFB_CACHE_RECT_SIZE) * EFB_CACHE_WIDTH + (x / EFB_CACHE_RECT_SIZE); diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp index 320f2d6752..7d81e4a10a 100644 --- a/Source/Core/VideoCommon/MainBase.cpp +++ b/Source/Core/VideoCommon/MainBase.cpp @@ -147,7 +147,7 @@ void VideoFifo_CheckEFBAccess() u32 VideoBackendHardware::Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData) { - if (s_BackendInitialized) + if (s_BackendInitialized && g_ActiveConfig.bEFBAccessEnable) { s_accessEFBArgs.type = type; s_accessEFBArgs.x = x; @@ -193,6 +193,11 @@ void VideoFifo_CheckPerfQueryRequest() u32 VideoBackendHardware::Video_GetQueryResult(PerfQueryType type) { + if(!g_perf_query->ShouldEmulate()) + { + return 0; + } + // TODO: Is this check sane? if (!g_perf_query->IsFlushed()) { diff --git a/Source/Core/VideoCommon/PerfQueryBase.h b/Source/Core/VideoCommon/PerfQueryBase.h index bf5474b4db..1136eeae2a 100644 --- a/Source/Core/VideoCommon/PerfQueryBase.h +++ b/Source/Core/VideoCommon/PerfQueryBase.h @@ -29,6 +29,7 @@ public: virtual ~PerfQueryBase() {} // Checks if performance queries are enabled in the gameini configuration. + // NOTE: Called from CPU+GPU thread bool ShouldEmulate() const; // Begin querying the specified value for the following host GPU commands