File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
benchmarks/multiplatform/benchmarks/src/commonMain/kotlin Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -57,21 +57,24 @@ suspend fun measureComposable(
57
57
repeat(warmupCount) {
58
58
scene.render(canvas, it * nanosPerFrame)
59
59
surface.flushAndSubmit(false )
60
+ graphicsContext?.awaitGPUCompletion()
60
61
}
61
62
62
- graphicsContext?.awaitGPUCompletion()
63
-
64
63
runGC()
65
64
66
65
var renderTime = Duration .ZERO
66
+ var gpuTime = Duration .ZERO
67
67
if (Args .isModeEnabled(Mode .CPU )) {
68
68
renderTime = measureTime {
69
69
repeat(frameCount) {
70
70
scene.render(canvas, it * nanosPerFrame)
71
71
surface.flushAndSubmit(false )
72
+ gpuTime + = measureTime {
73
+ graphicsContext?.awaitGPUCompletion()
74
+ }
72
75
}
73
76
}
74
- graphicsContext?.awaitGPUCompletion()
77
+ renderTime - = gpuTime
75
78
}
76
79
77
80
val frames = MutableList (frameCount) {
You can’t perform that action at this time.
0 commit comments