Frame generation: PSX_PRESENT_SHOT_GENERATED captures a generated frame

Diagnostic: a staged present_shot waits for the next generated frame, so the
in-between images can be inspected in game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shokunin
2026-10-06 05:03:23 -07:00
parent 1096174184
commit 1ed99213f2
+9 -1
View File
@@ -8496,7 +8496,15 @@ static void gl_swap_with_osd(void) {
extern int present_shot_take(char *out, int n);
extern void present_shot_done(int ok);
char shot_path[512];
if (present_shot_take(shot_path, (int)sizeof(shot_path))) {
/* PSX_PRESENT_SHOT_GENERATED=1 (diagnostic): a staged present_shot
* waits for the next generated frame (frame generation). */
static int gen_only = -1;
if (gen_only < 0) {
const char *e = getenv("PSX_PRESENT_SHOT_GENERATED");
gen_only = (e && *e && *e != '0') ? 1 : 0;
}
if ((!gen_only || s_fg_presenting) &&
present_shot_take(shot_path, (int)sizeof(shot_path))) {
int ww = 0, wh = 0;
int wrote = 0;
SDL_GL_GetDrawableSize(s_win, &ww, &wh);