diff --git a/benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt b/benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt index 409a8f772a..4bdaae5630 100644 --- a/benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt +++ b/benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt @@ -56,8 +56,11 @@ suspend fun measureComposable( // warmup repeat(warmupCount) { scene.render(canvas, it * nanosPerFrame) + surface.flushAndSubmit(false) } + graphicsContext?.awaitGPUCompletion() + runGC() var renderTime = Duration.ZERO @@ -65,8 +68,10 @@ suspend fun measureComposable( renderTime = measureTime { repeat(frameCount) { scene.render(canvas, it * nanosPerFrame) + surface.flushAndSubmit(false) } } + graphicsContext?.awaitGPUCompletion() } val frames = MutableList(frameCount) {