RegTest: Add PGXP/upscale/recompiler options
This commit is contained in:
parent
bc2c334370
commit
ad6e49998f
|
@ -15,21 +15,22 @@ def is_game_path(path):
|
||||||
return extension in ["cue", "chd"]
|
return extension in ["cue", "chd"]
|
||||||
|
|
||||||
|
|
||||||
def run_regression_test(runner, destdir, dump_interval, frames, renderer, gamepath):
|
def run_regression_test(runner, destdir, dump_interval, frames, renderer, cargs, gamepath):
|
||||||
args = [runner,
|
args = [runner,
|
||||||
"-log", "error",
|
"-log", "error",
|
||||||
"-dumpdir", destdir,
|
"-dumpdir", destdir,
|
||||||
"-dumpinterval", str(dump_interval),
|
"-dumpinterval", str(dump_interval),
|
||||||
"-frames", str(frames),
|
"-frames", str(frames),
|
||||||
"-renderer", ("Software" if renderer is None else renderer),
|
"-renderer", ("Software" if renderer is None else renderer),
|
||||||
"--", gamepath
|
|
||||||
]
|
]
|
||||||
|
args += cargs
|
||||||
|
args += ["--", gamepath]
|
||||||
|
|
||||||
print("Running '%s'" % (" ".join(args)))
|
print("Running '%s'" % (" ".join(args)))
|
||||||
subprocess.run(args)
|
subprocess.run(args)
|
||||||
|
|
||||||
|
|
||||||
def run_regression_tests(runner, gamedir, destdir, dump_interval, frames, parallel, renderer):
|
def run_regression_tests(runner, gamedir, destdir, dump_interval, frames, parallel, renderer, cargs):
|
||||||
paths = glob.glob(gamedir + "/*.*", recursive=True)
|
paths = glob.glob(gamedir + "/*.*", recursive=True)
|
||||||
gamepaths = list(filter(is_game_path, paths))
|
gamepaths = list(filter(is_game_path, paths))
|
||||||
|
|
||||||
|
@ -44,10 +45,10 @@ def run_regression_tests(runner, gamedir, destdir, dump_interval, frames, parall
|
||||||
|
|
||||||
if parallel <= 1:
|
if parallel <= 1:
|
||||||
for game in gamepaths:
|
for game in gamepaths:
|
||||||
run_regression_test(runner, destdir, dump_interval, frames, renderer, game)
|
run_regression_test(runner, destdir, dump_interval, frames, renderer, cargs, 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, destdir, dump_interval, frames, renderer)
|
func = partial(run_regression_test, runner, destdir, dump_interval, frames, renderer, cargs)
|
||||||
pool = multiprocessing.Pool(parallel)
|
pool = multiprocessing.Pool(parallel)
|
||||||
pool.map(func, gamepaths, chunksize=1)
|
pool.map(func, gamepaths, chunksize=1)
|
||||||
pool.close()
|
pool.close()
|
||||||
|
@ -65,10 +66,23 @@ if __name__ == "__main__":
|
||||||
parser.add_argument("-frames", action="store", type=int, default=36000, help="Number of frames to run")
|
parser.add_argument("-frames", action="store", type=int, default=36000, help="Number of frames to run")
|
||||||
parser.add_argument("-parallel", action="store", type=int, default=1, help="Number of processes to run")
|
parser.add_argument("-parallel", action="store", type=int, default=1, help="Number of processes to run")
|
||||||
parser.add_argument("-renderer", action="store", type=str, help="Renderer to use")
|
parser.add_argument("-renderer", action="store", type=str, help="Renderer to use")
|
||||||
|
parser.add_argument("-upscale", action="store", type=int, help="Upscale multiplier")
|
||||||
|
parser.add_argument("-pgxp", action="store_true", help="Enable PGXP")
|
||||||
|
parser.add_argument("-pgxpcpu", action="store_true", help="Enable PGXP CPU mode")
|
||||||
|
parser.add_argument("-cpu", action="store", help="CPU execution mode")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
cargs = []
|
||||||
|
if (args.upscale is not None):
|
||||||
|
cargs += ["-upscale", str(args.upscale)]
|
||||||
|
if (args.pgxp):
|
||||||
|
cargs += ["-pgxp"]
|
||||||
|
if (args.pgxpcpu):
|
||||||
|
cargs += ["-pgxp-cpu"]
|
||||||
|
if (args.cpu is not None):
|
||||||
|
cargs += ["-cpu", args.cpu]
|
||||||
|
|
||||||
if not run_regression_tests(args.runner, os.path.realpath(args.gamedir), os.path.realpath(args.destdir), args.dumpinterval, args.frames, args.parallel, args.renderer):
|
if not run_regression_tests(args.runner, os.path.realpath(args.gamedir), os.path.realpath(args.destdir), args.dumpinterval, args.frames, args.parallel, args.renderer, cargs):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
|
@ -549,6 +549,46 @@ bool RegTestHost::ParseCommandLineParameters(int argc, char* argv[], std::option
|
||||||
s_base_settings_interface->SetStringValue("GPU", "Renderer", Settings::GetRendererName(renderer.value()));
|
s_base_settings_interface->SetStringValue("GPU", "Renderer", Settings::GetRendererName(renderer.value()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (CHECK_ARG_PARAM("-upscale"))
|
||||||
|
{
|
||||||
|
const u32 upscale = StringUtil::FromChars<u32>(argv[++i]).value_or(0);
|
||||||
|
if (upscale == 0)
|
||||||
|
{
|
||||||
|
Log_ErrorPrint("Invalid upscale value.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log_InfoFmt("Setting upscale to {}.", upscale);
|
||||||
|
s_base_settings_interface->SetIntValue("GPU", "ResolutionScale", static_cast<s32>(upscale));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (CHECK_ARG_PARAM("-cpu"))
|
||||||
|
{
|
||||||
|
const std::optional<CPUExecutionMode> cpu = Settings::ParseCPUExecutionMode(argv[++i]);
|
||||||
|
if (!cpu.has_value())
|
||||||
|
{
|
||||||
|
Log_ErrorPrint("Invalid CPU execution mode.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log_InfoFmt("Setting CPU execution mode to {}.", Settings::GetCPUExecutionModeName(cpu.value()));
|
||||||
|
s_base_settings_interface->SetStringValue("CPU", "ExecutionMode",
|
||||||
|
Settings::GetCPUExecutionModeName(cpu.value()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (CHECK_ARG("-pgxp"))
|
||||||
|
{
|
||||||
|
Log_InfoPrint("Enabling PGXP.");
|
||||||
|
s_base_settings_interface->SetBoolValue("GPU", "PGXPEnable", true);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (CHECK_ARG("-pgxp-cpu"))
|
||||||
|
{
|
||||||
|
Log_InfoPrint("Enabling PGXP CPU mode.");
|
||||||
|
s_base_settings_interface->SetBoolValue("GPU", "PGXPEnable", true);
|
||||||
|
s_base_settings_interface->SetBoolValue("GPU", "PGXPCPU", true);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (CHECK_ARG("--"))
|
else if (CHECK_ARG("--"))
|
||||||
{
|
{
|
||||||
no_more_args = true;
|
no_more_args = true;
|
||||||
|
|
Loading…
Reference in New Issue