GSDumpRunner: Ability to enable manual hw hacks for testing

This commit is contained in:
refractionpcsx2 2023-02-07 22:18:43 +00:00
parent 8c3c9a1219
commit aea5c09825
2 changed files with 31 additions and 5 deletions

View File

@ -522,6 +522,27 @@ 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("-renderhacks"))
{
std::string str(argv[++i]);
s_settings_interface.SetBoolValue("EmuCore/GS", "UserHacks", true);
if(str.find("af") != std::string::npos)
s_settings_interface.SetBoolValue("EmuCore/GS", "UserHacks_AutoFlush", true);
if (str.find("cpufb") != std::string::npos)
s_settings_interface.SetBoolValue("EmuCore/GS", "UserHacks_CPU_FB_Conversion ", true);
if (str.find("dds") != std::string::npos)
s_settings_interface.SetBoolValue("EmuCore/GS", "UserHacks_DisableDepthSupport ", true);
if (str.find("dpi") != std::string::npos)
s_settings_interface.SetBoolValue("EmuCore/GS", "UserHacks_DisablePartialInvalidation ", true);
if (str.find("dsf") != std::string::npos)
s_settings_interface.SetBoolValue("EmuCore/GS", "UserHacks_DisableSafeFeatures ", true);
if (str.find("tinrt") != std::string::npos)
s_settings_interface.SetBoolValue("EmuCore/GS", "UserHacks_TextureInsideRt ", true);
continue;
}
else if (CHECK_ARG_PARAM("-logfile")) else if (CHECK_ARG_PARAM("-logfile"))
{ {
const char* logfile = argv[++i]; const char* logfile = argv[++i];

View File

@ -16,7 +16,7 @@ def is_gs_path(path):
return False return False
def run_regression_test(runner, dumpdir, renderer, parallel, gspath): def run_regression_test(runner, dumpdir, renderer, parallel, renderhacks, gspath):
args = [runner] args = [runner]
gsname = Path(gspath).name gsname = Path(gspath).name
while gsname.rfind('.') >= 0: while gsname.rfind('.') >= 0:
@ -28,6 +28,10 @@ def run_regression_test(runner, dumpdir, renderer, parallel, gspath):
if renderer is not None: if renderer is not None:
args.extend(["-renderer", renderer]) args.extend(["-renderer", renderer])
if renderhacks is not None:
args.extend(["-renderhacks", renderhacks])
args.extend(["-dumpdir", real_dumpdir]) args.extend(["-dumpdir", real_dumpdir])
args.extend(["-logfile", os.path.join(real_dumpdir, "emulog.txt")]) args.extend(["-logfile", os.path.join(real_dumpdir, "emulog.txt")])
@ -46,7 +50,7 @@ def run_regression_test(runner, dumpdir, renderer, parallel, gspath):
subprocess.run(args) subprocess.run(args)
def run_regression_tests(runner, gsdir, dumpdir, renderer, parallel=1): def run_regression_tests(runner, gsdir, dumpdir, renderer, 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))
@ -57,10 +61,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, parallel, game) run_regression_test(runner, dumpdir, renderer, parallel, renderhacks, 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) func = partial(run_regression_test, runner, dumpdir, renderer, parallel, renderhacks)
pool = multiprocessing.Pool(parallel) pool = multiprocessing.Pool(parallel)
pool.map(func, gamepaths) pool.map(func, gamepaths)
pool.close() pool.close()
@ -76,10 +80,11 @@ if __name__ == "__main__":
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("-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.parallel): if not run_regression_tests(args.runner, os.path.realpath(args.gsdir), os.path.realpath(args.dumpdir), args.renderer, args.renderhacks, args.parallel):
sys.exit(1) sys.exit(1)
else: else:
sys.exit(0) sys.exit(0)