mirror of https://github.com/PCSX2/pcsx2.git
GSRunner: Support upscale parameter
This commit is contained in:
parent
2c4e02ff34
commit
54e59e2f7b
|
@ -556,6 +556,19 @@ static bool ParseCommandLineArgs(int argc, char* argv[], VMBootParameters& param
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (CHECK_ARG_PARAM("-upscale"))
|
||||||
|
{
|
||||||
|
const float upscale = StringUtil::FromChars<float>(argv[++i]).value_or(0.0f);
|
||||||
|
if (upscale < 0.5f)
|
||||||
|
{
|
||||||
|
Console.WriteLn("Invalid upscale multiplier");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLn(fmt::format("Setting upscale multiplier to {}", upscale));
|
||||||
|
s_settings_interface.SetFloatValue("EmuCore/GS", "upscale_multiplier", upscale);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (CHECK_ARG_PARAM("-logfile"))
|
else if (CHECK_ARG_PARAM("-logfile"))
|
||||||
{
|
{
|
||||||
const char* logfile = argv[++i];
|
const char* logfile = argv[++i];
|
||||||
|
|
|
@ -16,7 +16,7 @@ def is_gs_path(path):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def run_regression_test(runner, dumpdir, renderer, parallel, renderhacks, gspath):
|
def run_regression_test(runner, dumpdir, renderer, upscale, renderhacks, parallel, gspath):
|
||||||
args = [runner]
|
args = [runner]
|
||||||
gsname = Path(gspath).name
|
gsname = Path(gspath).name
|
||||||
while gsname.rfind('.') >= 0:
|
while gsname.rfind('.') >= 0:
|
||||||
|
@ -28,6 +28,9 @@ def run_regression_test(runner, dumpdir, renderer, parallel, renderhacks, gspath
|
||||||
|
|
||||||
if renderer is not None:
|
if renderer is not None:
|
||||||
args.extend(["-renderer", renderer])
|
args.extend(["-renderer", renderer])
|
||||||
|
|
||||||
|
if upscale != 1.0:
|
||||||
|
args.extend(["-upscale", str(upscale)])
|
||||||
|
|
||||||
if renderhacks is not None:
|
if renderhacks is not None:
|
||||||
args.extend(["-renderhacks", renderhacks])
|
args.extend(["-renderhacks", renderhacks])
|
||||||
|
@ -50,7 +53,7 @@ def run_regression_test(runner, dumpdir, renderer, parallel, renderhacks, gspath
|
||||||
subprocess.run(args)
|
subprocess.run(args)
|
||||||
|
|
||||||
|
|
||||||
def run_regression_tests(runner, gsdir, dumpdir, renderer, renderhacks, parallel=1):
|
def run_regression_tests(runner, gsdir, dumpdir, renderer, upscale, renderhacks, parallel=1):
|
||||||
paths = glob.glob(gsdir + "/*.*", recursive=True)
|
paths = glob.glob(gsdir + "/*.*", recursive=True)
|
||||||
gamepaths = list(filter(is_gs_path, paths))
|
gamepaths = list(filter(is_gs_path, paths))
|
||||||
|
|
||||||
|
@ -61,10 +64,10 @@ def run_regression_tests(runner, gsdir, dumpdir, renderer, renderhacks, parallel
|
||||||
|
|
||||||
if parallel <= 1:
|
if parallel <= 1:
|
||||||
for game in gamepaths:
|
for game in gamepaths:
|
||||||
run_regression_test(runner, dumpdir, renderer, parallel, renderhacks, game)
|
run_regression_test(runner, dumpdir, renderer, upscale, renderhacks, 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, parallel, renderhacks)
|
func = partial(run_regression_test, runner, dumpdir, renderer, upscale, renderhacks, parallel)
|
||||||
pool = multiprocessing.Pool(parallel)
|
pool = multiprocessing.Pool(parallel)
|
||||||
pool.map(func, gamepaths)
|
pool.map(func, gamepaths)
|
||||||
pool.close()
|
pool.close()
|
||||||
|
@ -79,12 +82,13 @@ if __name__ == "__main__":
|
||||||
parser.add_argument("-gsdir", action="store", required=True, help="Directory containing GS dumps")
|
parser.add_argument("-gsdir", action="store", required=True, help="Directory containing GS dumps")
|
||||||
parser.add_argument("-dumpdir", action="store", required=True, help="Base directory to dump frames to")
|
parser.add_argument("-dumpdir", action="store", required=True, help="Base directory to dump frames to")
|
||||||
parser.add_argument("-renderer", action="store", required=False, help="Renderer to use")
|
parser.add_argument("-renderer", action="store", required=False, help="Renderer to use")
|
||||||
|
parser.add_argument("-upscale", action="store", type=float, default=1, help="Upscaling multiplier to use")
|
||||||
|
parser.add_argument("-renderhacks", action="store", required=False, help="Enable HW Rendering hacks")
|
||||||
parser.add_argument("-parallel", action="store", type=int, default=1, help="Number of proceeses to run")
|
parser.add_argument("-parallel", action="store", type=int, default=1, help="Number of proceeses to run")
|
||||||
parser.add_argument("-renderhacks", action="store", required=False, help="Enable HW Renering hacks")
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if not run_regression_tests(args.runner, os.path.realpath(args.gsdir), os.path.realpath(args.dumpdir), args.renderer, args.renderhacks, args.parallel):
|
if not run_regression_tests(args.runner, os.path.realpath(args.gsdir), os.path.realpath(args.dumpdir), args.renderer, args.upscale, args.renderhacks, args.parallel):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in New Issue