From 0cce8536dcd0c2d839ab263a049b3084c218fa62 Mon Sep 17 00:00:00 2001 From: Christoph Neuhauser Date: Fri, 1 Aug 2025 18:35:27 +0200 Subject: [PATCH] Fix: Tests: Two-stage shader compilation in EEVEE performance tests The EEVEE performance tests wait for shader compilation to finish before beginning to record performance. However, shader compilation can also happen after the first frame. This PR adds a check to the warmup phase to see if shader compilation is still happening. This happens, e.g., for the Mr. Elephant demo scene. Pull Request: https://projects.blender.org/blender/blender/pulls/143690 --- tests/performance/tests/eevee.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/performance/tests/eevee.py b/tests/performance/tests/eevee.py index d97b847d449..33ee0c6a6e6 100644 --- a/tests/performance/tests/eevee.py +++ b/tests/performance/tests/eevee.py @@ -72,7 +72,10 @@ def frame_change_handler(scene): elif record_stage == RecordStage.WARMUP: warmup_frame += 1 - if time.perf_counter() - start_warmup_time > WARMUP_SECONDS and warmup_frame > WARMUP_FRAMES: + # Check for two-stage shader compilation that can happen later than the first frame. + if hasattr(bpy.app, 'is_job_running') and bpy.app.is_job_running("SHADER_COMPILATION"): + record_stage = RecordStage.WAIT_SHADERS + elif time.perf_counter() - start_warmup_time > WARMUP_SECONDS and warmup_frame > WARMUP_FRAMES: start_record_time = time.perf_counter() playback_iteration = 0 num_frames = 0