Test switch: /app0/framegen-dump.txt dumps the frame generator's frames

This commit is contained in:
Mihawk committed 2026-10-10 21:42:42 -04:00
1 parent c85dd735b5
commit e19c2f31b7
1 file changed
+23
+23
View File
@@ -41,6 +41,7 @@
#include <system_error>
#include <typeinfo>
#include <pthread.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cxxabi.h>
@@ -449,6 +450,7 @@ int main(int process_argc, char **process_argv)
{
static const char *const test_files[] = {
"/app0/args.txt",
"/app0/framegen-dump.txt",
"/app0/pad-script.txt",
"/app0/pad-monitor.txt",
"/app0/ps5vk-no-retain.txt",
@@ -484,6 +486,27 @@ int main(int process_argc, char **process_argv)
setenv("RADV_THREADED_RECORDING", "1", 1);
ps5::debug::mark("radv: threaded recording on");
}
/* Testing: /app0/framegen-dump.txt (patch 0119) names a folder, and a second line
* the number of content frames to let pass first: the frame generator then writes
* its first 60 content frames and the frames it made there, raw RGBA8, for scoring. */
if (std::FILE *dump = std::fopen("/app0/framegen-dump.txt", "r"))
{
char folder[200] = "", skip[16] = "0";
if (std::fgets(folder, sizeof(folder), dump))
{
if (std::fgets(skip, sizeof(skip), dump) == nullptr)
std::strcpy(skip, "0");
folder[std::strcspn(folder, "\r\n")] = '\0';
if (folder[0] != '\0')
{
mkdir(folder, 0777);
setenv("PS5_FRAMEGEN_DUMP", folder, 1);
setenv("PS5_FRAMEGEN_DUMP_SKIP", skip, 1);
ps5::debug::mark("framegen: dumping frames");
}
}
std::fclose(dump);
}
if (std::FILE *profile = std::fopen("/app0/ps5vk-profile.txt", "rb"))
{
std::fclose(profile);