From 1529b878c35212de9fad65dd77917af6345c20a8 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 10 May 2026 05:33:27 -0700 Subject: [PATCH] =?UTF-8?q?fix(@projects/@magic-civilization):=20?= =?UTF-8?q?=F0=9F=90=9B=20adjust=20gpu=20flush=20timing=20in=20arc=20proof?= =?UTF-8?q?=20test?= 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 | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/game/engine/scenes/tests/gameplay_arc_proof.gd b/src/game/engine/scenes/tests/gameplay_arc_proof.gd index 5530d6d4..24eb5574 100644 --- a/src/game/engine/scenes/tests/gameplay_arc_proof.gd +++ b/src/game/engine/scenes/tests/gameplay_arc_proof.gd @@ -223,18 +223,15 @@ func _ready() -> void: func _capture_step(label: String, mode: String, focus: Vector2i = Vector2i.ZERO) -> void: - _sync_renderers() if mode == "focus": _focus_camera(focus, 5.0 * 384.0) else: _setup_camera_fit() - # 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 + _sync_renderers() + # Wall-clock wait so every queued canvas redraw and the camera transform + # both flush through the GPU composite before we read the texture. + # process_frame fires BEFORE draw; only a real timer hands the GPU time. + await get_tree().create_timer(0.5).timeout var image: Image = get_viewport().get_texture().get_image() if image == null: push_error("gameplay_arc: viewport image null at %s" % label)