Skip to content

Commit

Permalink
Add 60Hz sync option for testing(don't think it's required for AMD)
Browse files Browse the repository at this point in the history
Fix profiler merge messup.
  • Loading branch information
LunaMoo committed Jan 15, 2018
1 parent 5aa61aa commit 867293d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ static ConfigSetting graphicsSettings[] = {
ConfigSetting("RestartRequired", &g_Config.bRestartRequired, false, false),
#endif
ReportedConfigSetting("ForceMaxEmulatedFPS", &g_Config.iForceMaxEmulatedFPS, 60, true, true),
ConfigSetting("RefreshAt60Hz", &g_Config.bRefreshAt60Hz, false, true, true),

// Most low-performance (and many high performance) mobile GPUs do not support aniso anyway so defaulting to 4 is fine.
ConfigSetting("AnisotropyLevel", &g_Config.iAnisotropyLevel, 4, true, true),
Expand Down
1 change: 1 addition & 0 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ struct Config {
int iTexScalingType; // 0 = xBRZ, 1 = Hybrid
bool bTexDeposterize;
int iFpsLimit;
bool bRefreshAt60Hz;
bool bUnToggleFpsLimit;
int iForceMaxEmulatedFPS;
int iMaxRecent;
Expand Down
4 changes: 4 additions & 0 deletions Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
time_update();

float scaledTimestep = timestep;
if (g_Config.bRefreshAt60Hz)
scaledTimestep = scaledTimestep * 1.001f;
if (fpsLimiter == FPS_LIMIT_CUSTOM && g_Config.iFpsLimit != 0) {
scaledTimestep *= 60.0f / g_Config.iFpsLimit;
}
Expand Down Expand Up @@ -601,6 +603,8 @@ static void DoFrameIdleTiming() {
}

float scaledVblank = timePerVblank;
if (g_Config.bRefreshAt60Hz)
scaledVblank = scaledVblank * 1.001f;
if (PSP_CoreParameter().fpsLimit == FPS_LIMIT_CUSTOM) {
// 0 is handled in FrameTimingThrottled().
scaledVblank *= 60.0f / g_Config.iFpsLimit;
Expand Down
1 change: 1 addition & 0 deletions UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@ void OtherSettingsScreen::CreateViews() {
emulatedSpeed->SetZeroLabel(gr->T("Disabled"));
list->Add(new CheckBox(&g_Config.bShowFrameProfiler, gr->T("Display frame profiler(heavy!)")));
list->Add(new CheckBox(&g_Config.bSimpleFrameStats, gr->T("Display simple frame stats(heavy!)")));
list->Add(new CheckBox(&g_Config.bRefreshAt60Hz, gr->T("Refresh at 60Hz(might help some gpu's to avoid stutter)")));
}

void OtherSettingsScreen::onFinish(DialogResult result) {
Expand Down
8 changes: 5 additions & 3 deletions UI/ProfilerDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void DrawProfile(UIContext &ui) {
if (catStatus[i] == PROFILE_CAT_IGNORE) {
continue;
}
Profiler_GetHistory(i, &history[0], historyLength);
Profiler_GetSlowestHistory(i, &slowestThread[0], &history[0], historyLength);

float x = 10;
uint32_t col = nice_colors[i % ARRAY_SIZE(nice_colors)];
Expand Down Expand Up @@ -191,7 +191,6 @@ void DrawProfile(UIContext &ui) {
}
}
}
Profiler_GetSlowestHistory(i, &slowestThread[0], &history[0], historyLength);

for (int n = 0; n < historyLength; n++) {
if (total[n] > maxTotal)
Expand All @@ -215,8 +214,11 @@ void DrawProfile(UIContext &ui) {
float legendMinVal = lastMaxVal * (1.0f / 120.0f);

std::vector<float> history(historyLength);
std::vector<int> slowestThread(historyLength);
std::vector<ProfileCatStatus> catStatus(numCategories);

Profiler_GetSlowestThreads(&slowestThread[0], historyLength);

float rowH = 30.0f;
float legendHeight = 0.0f;
float legendWidth = 80.0f;
Expand All @@ -234,7 +236,7 @@ void DrawProfile(UIContext &ui) {
int numberOfFrames = 30;
for (int i = 0; i < numCategories; i++) {
const char *name = Profiler_GetCategoryName(i);
Profiler_GetHistory(i, &history[0], numberOfFrames);
Profiler_GetSlowestHistory(i, &slowestThread[0], &history[0], historyLength);
float val = 0;
for (int n = 0; n < numberOfFrames; n++) {
val += history[n];
Expand Down

0 comments on commit 867293d

Please sign in to comment.