Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoCommon: Make GPU syncing hack optional #1745

Merged
merged 1 commit into from Dec 27, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Source/Core/Core/ConfigManager.cpp
Expand Up @@ -314,6 +314,7 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("CPUThread", m_LocalCoreStartupParameter.bCPUThread);
core->Set("DSPHLE", m_LocalCoreStartupParameter.bDSPHLE);
core->Set("SkipIdle", m_LocalCoreStartupParameter.bSkipIdle);
core->Set("SyncOnSkipIdle", m_LocalCoreStartupParameter.bSyncGPUOnSkipIdleHack);
core->Set("DefaultISO", m_LocalCoreStartupParameter.m_strDefaultISO);
core->Set("DVDRoot", m_LocalCoreStartupParameter.m_strDVDRoot);
core->Set("Apploader", m_LocalCoreStartupParameter.m_strApploader);
Expand Down Expand Up @@ -540,6 +541,7 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("DSPHLE", &m_LocalCoreStartupParameter.bDSPHLE, true);
core->Get("CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true);
core->Get("SkipIdle", &m_LocalCoreStartupParameter.bSkipIdle, true);
core->Get("SyncOnSkipIdle", &m_LocalCoreStartupParameter.bSyncGPUOnSkipIdleHack, true);
core->Get("DefaultISO", &m_LocalCoreStartupParameter.m_strDefaultISO);
core->Get("DVDRoot", &m_LocalCoreStartupParameter.m_strDVDRoot);
core->Get("Apploader", &m_LocalCoreStartupParameter.m_strApploader);
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/CoreParameter.cpp
Expand Up @@ -34,7 +34,7 @@ SCoreStartupParameter::SCoreStartupParameter()
bJITILTimeProfiling(false), bJITILOutputIR(false),
bFPRF(false),
bCPUThread(true), bDSPThread(false), bDSPHLE(true),
bSkipIdle(true), bNTSC(false), bForceNTSCJ(false),
bSkipIdle(true), bSyncGPUOnSkipIdleHack(true), bNTSC(false), bForceNTSCJ(false),
bHLE_BS2(true), bEnableCheats(false),
bMergeBlocks(false), bEnableMemcardSaving(true),
bDPL2Decoder(false), iLatency(14),
Expand Down Expand Up @@ -69,6 +69,7 @@ void SCoreStartupParameter::LoadDefaults()
iCPUCore = CORE_JIT64;
bCPUThread = false;
bSkipIdle = false;
bSyncGPUOnSkipIdleHack = true;
bRunCompareServer = false;
bDSPHLE = true;
bFastmem = true;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/CoreParameter.h
Expand Up @@ -163,6 +163,7 @@ struct SCoreStartupParameter
bool bDSPThread;
bool bDSPHLE;
bool bSkipIdle;
bool bSyncGPUOnSkipIdleHack;
bool bNTSC;
bool bForceNTSCJ;
bool bHLE_BS2;
Expand Down
16 changes: 10 additions & 6 deletions Source/Core/Core/CoreTiming.cpp
Expand Up @@ -11,6 +11,7 @@
#include "Common/StringUtil.h"
#include "Common/Thread.h"

#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/CoreTiming.h"
#include "Core/PowerPC/PowerPC.h"
Expand Down Expand Up @@ -443,13 +444,16 @@ void Idle()
{
//DEBUG_LOG(POWERPC, "Idle");

//When the FIFO is processing data we must not advance because in this way
//the VI will be desynchronized. So, We are waiting until the FIFO finish and
//while we process only the events required by the FIFO.
while (g_video_backend->Video_IsPossibleWaitingSetDrawDone())
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bSyncGPUOnSkipIdleHack)
{
ProcessFifoWaitEvents();
Common::YieldCPU();
//When the FIFO is processing data we must not advance because in this way
//the VI will be desynchronized. So, We are waiting until the FIFO finish and
//while we process only the events required by the FIFO.
while (g_video_backend->Video_IsPossibleWaitingSetDrawDone())
{
ProcessFifoWaitEvents();
Common::YieldCPU();
}
}

idledCycles += PowerPC::ppcState.downcount;
Expand Down