Skip to content

Commit

Permalink
Remove the setting to run the display list interpreter on a separate …
Browse files Browse the repository at this point in the history
…thread.
  • Loading branch information
hrydgard committed Nov 5, 2017
1 parent 3c591ad commit be2ba4f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 28 deletions.
1 change: 0 additions & 1 deletion Core/Config.cpp
Expand Up @@ -406,7 +406,6 @@ static bool DefaultSasThread() {

static ConfigSetting cpuSettings[] = {
ReportedConfigSetting("CPUCore", &g_Config.iCpuCore, &DefaultCpuCore, true, true),
ReportedConfigSetting("SeparateCPUThread", &g_Config.bSeparateCPUThread, false, true, true),
ReportedConfigSetting("SeparateSASThread", &g_Config.bSeparateSASThread, &DefaultSasThread, true, true),
ReportedConfigSetting("SeparateIOThread", &g_Config.bSeparateIOThread, true, true, true),
ReportedConfigSetting("IOTimingMethod", &g_Config.iIOTimingMethod, IOTIMING_FAST, true, true),
Expand Down
2 changes: 0 additions & 2 deletions Core/Config.h
Expand Up @@ -132,8 +132,6 @@ struct Config {
bool bFuncReplacements;
bool bHideSlowWarnings;

// Definitely cannot be changed while game is running.
bool bSeparateCPUThread;
bool bSeparateSASThread;
bool bSeparateIOThread;
int iIOTimingMethod;
Expand Down
26 changes: 15 additions & 11 deletions Core/System.cpp
Expand Up @@ -392,10 +392,10 @@ void System_Wake() {
// Ugly!
static bool pspIsInited = false;
static bool pspIsIniting = false;
static bool pspIsQuiting = false;
static bool pspIsQuitting = false;

bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) {
if (pspIsIniting || pspIsQuiting) {
if (pspIsIniting || pspIsQuitting) {
return false;
}

Expand All @@ -415,7 +415,9 @@ bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) {
coreParameter.errorString = "";
pspIsIniting = true;

if (g_Config.bSeparateCPUThread) {
// Keeping this around because we might need it in the future.
const bool separateCPUThread = false;
if (separateCPUThread) {
Core_ListenShutdown(System_Wake);
CPU_SetState(CPU_THREAD_PENDING);
cpuThread = new std::thread(&CPU_RunLoop);
Expand All @@ -438,7 +440,7 @@ bool PSP_InitUpdate(std::string *error_string) {
return true;
}

if (g_Config.bSeparateCPUThread && !CPU_IsReady()) {
if (!CPU_IsReady()) {
return false;
}

Expand All @@ -459,7 +461,8 @@ bool PSP_InitUpdate(std::string *error_string) {
bool PSP_Init(const CoreParameter &coreParam, std::string *error_string) {
PSP_InitStart(coreParam, error_string);

if (g_Config.bSeparateCPUThread) {
// For a potential resurrection of separate CPU thread later.
if (false) {
CPU_WaitStatus(cpuThreadReplyCond, &CPU_IsReady);
}

Expand All @@ -472,12 +475,12 @@ bool PSP_IsIniting() {
}

bool PSP_IsInited() {
return pspIsInited && !pspIsQuiting;
return pspIsInited && !pspIsQuitting;
}

void PSP_Shutdown() {
// Do nothing if we never inited.
if (!pspIsInited && !pspIsIniting && !pspIsQuiting) {
if (!pspIsInited && !pspIsIniting && !pspIsQuitting) {
return;
}

Expand All @@ -488,7 +491,7 @@ void PSP_Shutdown() {
#endif

// Make sure things know right away that PSP memory, etc. is going away.
pspIsQuiting = true;
pspIsQuitting = true;
if (coreState == CORE_RUNNING)
Core_UpdateState(CORE_ERROR);
Core_NotifyShutdown();
Expand All @@ -507,7 +510,7 @@ void PSP_Shutdown() {
currentMIPS = 0;
pspIsInited = false;
pspIsIniting = false;
pspIsQuiting = false;
pspIsQuitting = false;
g_Config.unloadGameConfig();
}

Expand All @@ -532,8 +535,9 @@ void PSP_RunLoopUntil(u64 globalticks) {
return;
}

// Switch the CPU thread on or off, as the case may be.
bool useCPUThread = g_Config.bSeparateCPUThread;
// We no longer allow a separate CPU thread but if we add a render queue
// to GL we're gonna need it.
bool useCPUThread = false;
if (useCPUThread && cpuThread == nullptr) {
// Need to start the cpu thread.
Core_ListenShutdown(System_Wake);
Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUCommon.cpp
Expand Up @@ -359,11 +359,11 @@ GPUCommon::GPUCommon(GraphicsContext *gfxCtx, Draw::DrawContext *draw) :
// The compiler was not rounding the struct size up to an 8 byte boundary, which
// you'd expect due to the int64 field, but the Linux ABI apparently does not require that.
static_assert(sizeof(DisplayList) == 456, "Bad DisplayList size");
listLock.set_enabled(g_Config.bSeparateCPUThread);
listLock.set_enabled(false);

Reinitialize();
SetupColorConv();
SetThreadEnabled(g_Config.bSeparateCPUThread);
SetThreadEnabled(false);
gstate.Reset();
gstate_c.Reset();
gpuStats.Reset();
Expand Down
5 changes: 0 additions & 5 deletions GPU/Software/SoftGpu.cpp
Expand Up @@ -913,11 +913,6 @@ bool SoftGPU::PerformStencilUpload(u32 dest, int size)
}

bool SoftGPU::FramebufferDirty() {
if (g_Config.bSeparateCPUThread) {
// Allow it to process fully before deciding if it's dirty.
SyncThread();
}

if (g_Config.iFrameSkip != 0) {
bool dirty = framebufferDirty_;
framebufferDirty_ = false;
Expand Down
7 changes: 0 additions & 7 deletions UI/GameSettingsScreen.cpp
Expand Up @@ -661,13 +661,6 @@ void GameSettingsScreen::CreateViews() {

systemSettings->Add(new CheckBox(&g_Config.bFastMemory, sy->T("Fast Memory", "Fast Memory (Unstable)")))->OnClick.Handle(this, &GameSettingsScreen::OnJitAffectingSetting);

auto separateCPUThread = new CheckBox(&g_Config.bSeparateCPUThread, sy->T("Multithreaded (experimental)"));
systemSettings->Add(separateCPUThread);
separateCPUThread->OnClick.Add([=](EventParams &e) {
if (g_Config.bSeparateCPUThread)
settingInfo_->Show(sy->T("Multithreaded Tip", "Not always faster, causes glitches/crashing"), e.v);
return UI::EVENT_CONTINUE;
});
systemSettings->Add(new CheckBox(&g_Config.bSeparateIOThread, sy->T("I/O on thread (experimental)")))->SetEnabled(!PSP_IsInited());
static const char *ioTimingMethods[] = { "Fast (lag on slow storage)", "Host (bugs, less lag)", "Simulate UMD delays" };
View *ioTimingMethod = systemSettings->Add(new PopupMultiChoice(&g_Config.iIOTimingMethod, sy->T("IO timing method"), ioTimingMethods, 0, ARRAY_SIZE(ioTimingMethods), sy->GetName(), screenManager()));
Expand Down

0 comments on commit be2ba4f

Please sign in to comment.