Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
degasus committed Jan 9, 2014
1 parent 45f7484 commit eb310cb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 0 additions & 3 deletions Source/Core/VideoBackends/D3D/Render.cpp
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/VideoBackends/OGL/Render.cpp
Expand Up @@ -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);

Expand Down
7 changes: 6 additions & 1 deletion Source/Core/VideoCommon/MainBase.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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())
{
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/PerfQueryBase.h
Expand Up @@ -29,6 +29,7 @@ class PerfQueryBase
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
Expand Down

0 comments on commit eb310cb

Please sign in to comment.