From 2c1212c4e72637bb1067abbee945add9b47f0ddf Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 10 May 2026 05:28:22 -0700 Subject: [PATCH] =?UTF-8?q?fix(@projects/@magic-civilization):=20?= =?UTF-8?q?=F0=9F=90=9B=20adjust=20frame=20timing=20for=20viewport=20textu?= =?UTF-8?q?re=20capture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/game/engine/scenes/tests/gameplay_arc_proof.gd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/game/engine/scenes/tests/gameplay_arc_proof.gd b/src/game/engine/scenes/tests/gameplay_arc_proof.gd index 37cf2b8e..5530d6d4 100644 --- a/src/game/engine/scenes/tests/gameplay_arc_proof.gd +++ b/src/game/engine/scenes/tests/gameplay_arc_proof.gd @@ -228,9 +228,13 @@ func _capture_step(label: String, mode: String, focus: Vector2i = Vector2i.ZERO) _focus_camera(focus, 5.0 * 384.0) else: _setup_camera_fit() - # Multiple frames so the canvas items finish redraw + camera resolves. - for _i: int in range(8): + # Wait two real frames-rendered to flush the GPU composite. process_frame + # fires before draw; frame_post_draw fires AFTER GPU composite, which is + # what `get_viewport().get_texture()` actually reads. + for _i: int in range(3): await get_tree().process_frame + for _j: int in range(2): + await RenderingServer.frame_post_draw var image: Image = get_viewport().get_texture().get_image() if image == null: push_error("gameplay_arc: viewport image null at %s" % label)