mirror of https://github.com/PCSX2/pcsx2.git
GSRunner: Write log and disable cache in parallel runs
This commit is contained in:
parent
5e9710a8c6
commit
dc8cdc95d0
|
@ -129,6 +129,13 @@ bool GSRunner::InitializeConfig()
|
||||||
si.SetBoolValue("EmuCore/GS", "OsdShowResolution", true);
|
si.SetBoolValue("EmuCore/GS", "OsdShowResolution", true);
|
||||||
si.SetBoolValue("EmuCore/GS", "OsdShowGSStats", true);
|
si.SetBoolValue("EmuCore/GS", "OsdShowGSStats", true);
|
||||||
|
|
||||||
|
// remove memory cards, so we don't have sharing violations
|
||||||
|
for (u32 i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
si.SetBoolValue("MemoryCards", fmt::format("Slot{}_Enable", i + 1).c_str(), false);
|
||||||
|
si.SetStringValue("MemoryCards", fmt::format("Slot{}_Filename", i + 1).c_str(), "");
|
||||||
|
}
|
||||||
|
|
||||||
CommonHost::LoadStartupSettings();
|
CommonHost::LoadStartupSettings();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -436,6 +443,8 @@ static void PrintCommandLineHelp(const char* progname)
|
||||||
std::fprintf(stderr, " -renderer <renderer>: Sets the graphics renderer. Defaults to Auto.\n");
|
std::fprintf(stderr, " -renderer <renderer>: Sets the graphics renderer. Defaults to Auto.\n");
|
||||||
std::fprintf(stderr, " -window: Forces a window to be displayed.\n");
|
std::fprintf(stderr, " -window: Forces a window to be displayed.\n");
|
||||||
std::fprintf(stderr, " -surfaceless: Disables showing a window.\n");
|
std::fprintf(stderr, " -surfaceless: Disables showing a window.\n");
|
||||||
|
std::fprintf(stderr, " -logfile <filename>: Writes emu log to filename.\n");
|
||||||
|
std::fprintf(stderr, " -noshadercache: Disables the shader cache (useful for parallel runs).\n");
|
||||||
std::fprintf(stderr, " --: Signals that no more arguments will follow and the remaining\n"
|
std::fprintf(stderr, " --: Signals that no more arguments will follow and the remaining\n"
|
||||||
" parameters make up the filename. Use when the filename contains\n"
|
" parameters make up the filename. Use when the filename contains\n"
|
||||||
" spaces or starts with a dash.\n");
|
" spaces or starts with a dash.\n");
|
||||||
|
@ -522,6 +531,26 @@ static bool ParseCommandLineArgs(int argc, char* argv[], VMBootParameters& param
|
||||||
s_settings_interface.SetIntValue("EmuCore/GS", "Renderer", static_cast<int>(type));
|
s_settings_interface.SetIntValue("EmuCore/GS", "Renderer", static_cast<int>(type));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (CHECK_ARG_PARAM("-logfile"))
|
||||||
|
{
|
||||||
|
const char* logfile = argv[++i];
|
||||||
|
if (std::strlen(logfile) > 0)
|
||||||
|
{
|
||||||
|
// disable timestamps, since we want to be able to diff the logs
|
||||||
|
Console.WriteLn("Logging to %s...", logfile);
|
||||||
|
CommonHost::SetFileLogPath(logfile);
|
||||||
|
s_settings_interface.SetBoolValue("Logging", "EnableFileLogging", true);
|
||||||
|
s_settings_interface.SetBoolValue("Logging", "EnableTimestamps", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (CHECK_ARG("-noshadercache"))
|
||||||
|
{
|
||||||
|
Console.WriteLn("Disabling shader cache");
|
||||||
|
s_settings_interface.SetBoolValue("EmuCore/GS", "disable_shader_cache", false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (CHECK_ARG("-window"))
|
else if (CHECK_ARG("-window"))
|
||||||
{
|
{
|
||||||
Console.WriteLn("Creating window");
|
Console.WriteLn("Creating window");
|
||||||
|
@ -608,6 +637,7 @@ int main(int argc, char* argv[])
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// apply new settings (e.g. pick up renderer change)
|
||||||
VMManager::ApplySettings();
|
VMManager::ApplySettings();
|
||||||
|
|
||||||
if (VMManager::Initialize(params))
|
if (VMManager::Initialize(params))
|
||||||
|
|
|
@ -16,24 +16,29 @@ def is_gs_path(path):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def run_regression_test(runner, dumpdir, renderer, gspath):
|
def run_regression_test(runner, dumpdir, renderer, parallel, gspath):
|
||||||
args = [runner]
|
args = [runner]
|
||||||
gsname = Path(gspath).name
|
gsname = Path(gspath).name
|
||||||
while gsname.rfind('.') >= 0:
|
while gsname.rfind('.') >= 0:
|
||||||
gsname = gsname[:gsname.rfind('.')]
|
gsname = gsname[:gsname.rfind('.')]
|
||||||
|
|
||||||
real_dumpdir = os.path.join(dumpdir, gsname)
|
real_dumpdir = os.path.join(dumpdir, gsname).strip()
|
||||||
if not os.path.exists(real_dumpdir):
|
if not os.path.exists(real_dumpdir):
|
||||||
os.mkdir(real_dumpdir)
|
os.mkdir(real_dumpdir)
|
||||||
|
|
||||||
if renderer is not None:
|
if renderer is not None:
|
||||||
args.extend(["-renderer", renderer])
|
args.extend(["-renderer", renderer])
|
||||||
args.extend(["-dumpdir", real_dumpdir])
|
args.extend(["-dumpdir", real_dumpdir])
|
||||||
|
args.extend(["-logfile", os.path.join(real_dumpdir, "emulog.txt")])
|
||||||
|
|
||||||
# loop a couple of times for those stubborn merge/interlace dumps that don't render anything
|
# loop a couple of times for those stubborn merge/interlace dumps that don't render anything
|
||||||
# the first time around
|
# the first time around
|
||||||
args.extend(["-loop", "2"])
|
args.extend(["-loop", "2"])
|
||||||
|
|
||||||
|
# disable shader cache for parallel runs, otherwise it'll have sharing violations
|
||||||
|
if parallel > 1:
|
||||||
|
args.append("-noshadercache")
|
||||||
|
|
||||||
args.append("--")
|
args.append("--")
|
||||||
args.append(gspath)
|
args.append(gspath)
|
||||||
|
|
||||||
|
@ -52,10 +57,10 @@ def run_regression_tests(runner, gsdir, dumpdir, renderer, parallel=1):
|
||||||
|
|
||||||
if parallel <= 1:
|
if parallel <= 1:
|
||||||
for game in gamepaths:
|
for game in gamepaths:
|
||||||
run_regression_test(runner, dumpdir, renderer, game)
|
run_regression_test(runner, dumpdir, renderer, parallel, game)
|
||||||
else:
|
else:
|
||||||
print("Processing %u games on %u processors" % (len(gamepaths), parallel))
|
print("Processing %u games on %u processors" % (len(gamepaths), parallel))
|
||||||
func = partial(run_regression_test, runner, dumpdir, renderer)
|
func = partial(run_regression_test, runner, dumpdir, renderer, parallel)
|
||||||
pool = multiprocessing.Pool(parallel)
|
pool = multiprocessing.Pool(parallel)
|
||||||
pool.map(func, gamepaths)
|
pool.map(func, gamepaths)
|
||||||
pool.close()
|
pool.close()
|
||||||
|
|
Loading…
Reference in New Issue