Browse Source

Add iOS target to multiplatform benchmarks (#5176)

Fixes
[CMP-6807](https://youtrack.jetbrains.com/issue/CMP-6807/Add-iOS-target-to-our-own-benchmarks)
pull/4977/merge v1.8.0+dev1981
Nikita Lipsky 2 days ago committed by GitHub
parent
commit
ac1d6e7340
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 13
      benchmarks/multiplatform/README.md
  2. 98
      benchmarks/multiplatform/benchmarks/build.gradle.kts
  3. 74
      benchmarks/multiplatform/benchmarks/src/appleMain/kotlin/GraphicsContext.apple.kt
  4. 0
      benchmarks/multiplatform/benchmarks/src/appleMain/kotlin/runGC.native.kt
  5. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/composeResources/drawable/compose-multiplatform.xml
  6. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/Args.kt
  7. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/Benchmarks.kt
  8. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt
  9. 4
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/animation/AnimatedVisibility.kt
  10. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/MainUI.kt
  11. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/MultiLevelCell.kt
  12. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/LoadingIndicator.kt
  13. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeProgress.kt
  14. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeRefreshLayout.kt
  15. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeRefreshNestedScrollConnection.kt
  16. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeRefreshState.kt
  17. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/FollowItem.kt
  18. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/HotItem.kt
  19. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/IBaseViewModel.kt
  20. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/ICompositionModel.kt
  21. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/ViewModelFactory.kt
  22. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/lazygrid/LazyGrid.kt
  23. 0
      benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/visualeffects/HappyNY.kt
  24. 0
      benchmarks/multiplatform/benchmarks/src/desktopMain/kotlin/main.desktop.kt
  25. 0
      benchmarks/multiplatform/benchmarks/src/desktopMain/kotlin/runGC.jvm.kt
  26. 11
      benchmarks/multiplatform/benchmarks/src/iosMain/kotlin/main.ios.kt
  27. 10
      benchmarks/multiplatform/benchmarks/src/macosMain/kotlin/main.macos.kt
  28. 0
      benchmarks/multiplatform/benchmarks/src/wasmJsMain/kotlin/main.wasmJs.kt
  29. 0
      benchmarks/multiplatform/benchmarks/src/wasmJsMain/kotlin/runGC.wasmJs.kt
  30. 2
      benchmarks/multiplatform/benchmarks/src/wasmJsMain/resources/index.html
  31. 98
      benchmarks/multiplatform/build.gradle.kts
  32. 2
      benchmarks/multiplatform/gradle.properties
  33. 3
      benchmarks/multiplatform/iosApp/Configuration/Config.xcconfig
  34. 382
      benchmarks/multiplatform/iosApp/iosApp.xcodeproj/project.pbxproj
  35. 11
      benchmarks/multiplatform/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json
  36. 98
      benchmarks/multiplatform/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json
  37. 6
      benchmarks/multiplatform/iosApp/iosApp/Assets.xcassets/Contents.json
  38. 11
      benchmarks/multiplatform/iosApp/iosApp/ContentView.swift
  39. 50
      benchmarks/multiplatform/iosApp/iosApp/Info.plist
  40. 6
      benchmarks/multiplatform/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json
  41. 15
      benchmarks/multiplatform/iosApp/iosApp/iOSApp.swift
  42. 2
      benchmarks/multiplatform/settings.gradle.kts
  43. 68
      benchmarks/multiplatform/src/macosMain/kotlin/main.macos.kt

13
benchmarks/multiplatform/README.md

@ -1,11 +1,16 @@
# Compose Multiplatform benchmarks
## Run Desktop
- `./gradlew :run`
- `./gradlew :benchmarks:run`
## Run native on iOS
Open the project in Fleet or Android Studio with KMM plugin installed and
choose `iosApp` run configuration. Make sure that you build the app in `Release` configuration.
Alternatively you may open `iosApp/iosApp` project in XCode and run the app from there.
## Run native on MacOS
- `./gradlew runReleaseExecutableMacosArm64` (Works on Arm64 processors)
- `./gradlew runReleaseExecutableMacosX64` (Works on Intel processors)
- `./gradlew :benchmarks:runReleaseExecutableMacosArm64` (Works on Arm64 processors)
- `./gradlew :benchmarks:runReleaseExecutableMacosX64` (Works on Intel processors)
## Run in web browser:
@ -13,4 +18,4 @@ Please run your browser with manual GC enabled before running the benchmark, lik
`open -a Google\ Chrome --args --js-flags="--expose-gc"`
- `./gradlew wasmJsBrowserProductionRun` (you can see the results printed on the page itself)
- `./gradlew :benchmarks:wasmJsBrowserProductionRun` (you can see the results printed on the page itself)

98
benchmarks/multiplatform/benchmarks/build.gradle.kts

@ -0,0 +1,98 @@
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack
plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.compose")
}
version = "1.0-SNAPSHOT"
repositories {
mavenLocal()
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
kotlin {
jvm("desktop")
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "benchmarks"
isStatic = true
}
}
listOf(
macosX64(),
macosArm64()
).forEach { macosTarget ->
macosTarget.binaries {
executable {
entryPoint = "main"
}
}
}
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
binaries.executable()
browser ()
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.runtime)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
}
}
val desktopMain by getting {
dependencies {
implementation(compose.desktop.currentOs)
runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.7.1")
}
}
}
}
compose.desktop {
application {
mainClass = "Main_desktopKt"
}
}
val runArguments: String? by project
// Handle runArguments property
gradle.taskGraph.whenReady {
tasks.named<JavaExec>("run") {
args(runArguments?.split(" ") ?: listOf<String>())
}
tasks.forEach { t ->
if ((t is Exec) && t.name.startsWith("runReleaseExecutableMacos")) {
t.args(runArguments?.split(" ") ?: listOf<String>())
}
}
tasks.named<KotlinWebpack>("wasmJsBrowserProductionRun") {
val args = runArguments?.split(" ")
?.mapIndexed { index, arg -> "arg$index=$arg" }
?.joinToString("&") ?: ""
devServerProperty = devServerProperty.get().copy(
open = "http://localhost:8080?$args"
)
}
}

74
benchmarks/multiplatform/benchmarks/src/appleMain/kotlin/GraphicsContext.apple.kt

@ -0,0 +1,74 @@
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.objcPtr
import org.jetbrains.skia.BackendRenderTarget
import org.jetbrains.skia.ColorSpace
import org.jetbrains.skia.DirectContext
import org.jetbrains.skia.PixelGeometry
import org.jetbrains.skia.Surface
import org.jetbrains.skia.SurfaceColorFormat
import org.jetbrains.skia.SurfaceOrigin
import org.jetbrains.skia.SurfaceProps
import platform.Metal.MTLCreateSystemDefaultDevice
import platform.Metal.MTLPixelFormatBGRA8Unorm
import platform.Metal.MTLTextureDescriptor
import platform.Metal.MTLTextureType2D
import platform.Metal.MTLTextureUsageRenderTarget
import platform.Metal.MTLTextureUsageShaderRead
import platform.Metal.MTLTextureUsageShaderWrite
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
@OptIn(ExperimentalForeignApi::class)
fun graphicsContext() = object : GraphicsContext {
private val device = MTLCreateSystemDefaultDevice() ?: throw IllegalStateException("Can't create MTLDevice")
private val commandQueue = device.newCommandQueue() ?: throw IllegalStateException("Can't create MTLCommandQueue")
private val directContext = DirectContext.makeMetal(device.objcPtr(), commandQueue.objcPtr())
private var cachedSurface: Surface? = null
override fun surface(width: Int, height: Int): Surface {
val oldSurface = cachedSurface
if (oldSurface != null && oldSurface.width == width && oldSurface.height == height) {
return oldSurface
}
val descriptor = MTLTextureDescriptor()
descriptor.width = width.toULong()
descriptor.height = height.toULong()
descriptor.usage = MTLTextureUsageShaderRead or MTLTextureUsageShaderWrite or MTLTextureUsageRenderTarget
descriptor.textureType = MTLTextureType2D
descriptor.pixelFormat = MTLPixelFormatBGRA8Unorm
descriptor.mipmapLevelCount = 1UL
val texture = device.newTextureWithDescriptor(descriptor) ?: throw IllegalStateException("Can't create MTLTexture")
val renderTarget = BackendRenderTarget.makeMetal(width, height, texture.objcPtr())
return Surface.makeFromBackendRenderTarget(
directContext,
renderTarget,
SurfaceOrigin.TOP_LEFT,
SurfaceColorFormat.BGRA_8888,
ColorSpace.sRGB,
SurfaceProps(pixelGeometry = PixelGeometry.UNKNOWN)
).also {
cachedSurface = it
} ?: throw IllegalStateException("Can't create Surface")
}
override suspend fun awaitGPUCompletion() {
val commandBuffer = commandQueue.commandBuffer() ?: return
suspendCoroutine { continuation ->
commandBuffer.addCompletedHandler {
continuation.resume(Unit)
}
commandBuffer.commit()
}
}
}

0
benchmarks/multiplatform/src/macosMain/kotlin/runGC.native.kt → benchmarks/multiplatform/benchmarks/src/appleMain/kotlin/runGC.native.kt

0
benchmarks/multiplatform/src/commonMain/composeResources/drawable/compose-multiplatform.xml → benchmarks/multiplatform/benchmarks/src/commonMain/composeResources/drawable/compose-multiplatform.xml

0
benchmarks/multiplatform/src/commonMain/kotlin/Args.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/Args.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/Benchmarks.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/Benchmarks.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/MeasureComposable.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt

4
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/animation/AnimatedVisibility.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/animation/AnimatedVisibility.kt

@ -13,8 +13,8 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import compose_benchmarks.generated.resources.Res
import compose_benchmarks.generated.resources.compose_multiplatform
import compose_benchmarks.benchmarks.generated.resources.Res
import compose_benchmarks.benchmarks.generated.resources.compose_multiplatform
import kotlinx.coroutines.delay
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/components/MainUI.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/MainUI.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/components/MultiLevelCell.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/MultiLevelCell.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/LoadingIndicator.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/LoadingIndicator.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeProgress.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeProgress.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeRefreshLayout.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeRefreshLayout.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeRefreshNestedScrollConnection.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeRefreshNestedScrollConnection.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeRefreshState.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/components/refresh/SwipeRefreshState.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/models/FollowItem.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/FollowItem.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/models/HotItem.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/HotItem.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/models/IBaseViewModel.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/IBaseViewModel.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/models/ICompositionModel.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/ICompositionModel.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/complexlazylist/models/ViewModelFactory.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/complexlazylist/models/ViewModelFactory.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/lazygrid/LazyGrid.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/lazygrid/LazyGrid.kt

0
benchmarks/multiplatform/src/commonMain/kotlin/benchmarks/visualeffects/HappyNY.kt → benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/benchmarks/visualeffects/HappyNY.kt

0
benchmarks/multiplatform/src/desktopMain/kotlin/main.desktop.kt → benchmarks/multiplatform/benchmarks/src/desktopMain/kotlin/main.desktop.kt

0
benchmarks/multiplatform/src/desktopMain/kotlin/runGC.jvm.kt → benchmarks/multiplatform/benchmarks/src/desktopMain/kotlin/runGC.jvm.kt

11
benchmarks/multiplatform/benchmarks/src/iosMain/kotlin/main.ios.kt

@ -0,0 +1,11 @@
/*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
import kotlinx.coroutines.runBlocking
fun main(args : List<String>) {
Args.parseArgs(args.toTypedArray())
runBlocking { runBenchmarks(graphicsContext = graphicsContext()) }
}

10
benchmarks/multiplatform/benchmarks/src/macosMain/kotlin/main.macos.kt

@ -0,0 +1,10 @@
/*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
import kotlinx.coroutines.runBlocking
fun main(args : Array<String>) {
Args.parseArgs(args)
runBlocking { runBenchmarks(graphicsContext = graphicsContext()) }
}

0
benchmarks/multiplatform/src/wasmJsMain/kotlin/main.wasmJs.kt → benchmarks/multiplatform/benchmarks/src/wasmJsMain/kotlin/main.wasmJs.kt

0
benchmarks/multiplatform/src/wasmJsMain/kotlin/runGC.wasmJs.kt → benchmarks/multiplatform/benchmarks/src/wasmJsMain/kotlin/runGC.wasmJs.kt

2
benchmarks/multiplatform/src/wasmJsMain/resources/index.html → benchmarks/multiplatform/benchmarks/src/wasmJsMain/resources/index.html

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>Benchmarks Compose + K/Wasm</title>
<script src="compose-benchmarks.js"></script>
<script src="benchmarks.js"></script>
<script type="application/javascript">
const log = console.log.bind(console)
console.log = (...args) => {

98
benchmarks/multiplatform/build.gradle.kts

@ -1,101 +1,15 @@
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack
plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.compose")
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
kotlin("multiplatform") apply false
kotlin("plugin.compose") apply false
id("org.jetbrains.compose") apply false
}
version = "1.0-SNAPSHOT"
allprojects {
repositories {
mavenLocal()
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
kotlin {
jvm("desktop")
macosX64 {
binaries {
executable {
entryPoint = "main"
}
}
}
macosArm64 {
binaries {
executable {
entryPoint = "main"
}
}
}
wasmJs {
binaries.executable()
browser ()
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.runtime)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
}
}
val desktopMain by getting {
dependencies {
implementation(compose.desktop.currentOs)
runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.7.1")
}
}
val nativeMain by creating {
dependsOn(commonMain)
}
val macosMain by creating {
dependsOn(nativeMain)
}
val macosX64Main by getting {
dependsOn(macosMain)
}
val macosArm64Main by getting {
dependsOn(macosMain)
}
}
}
compose.desktop {
application {
mainClass = "Main_desktopKt"
}
}
val runArguments: String? by project
// Handle runArguments property
gradle.taskGraph.whenReady {
tasks.named<JavaExec>("run") {
args(runArguments?.split(" ") ?: listOf<String>())
}
tasks.forEach { t ->
if ((t is Exec) && t.name.startsWith("runReleaseExecutableMacos")) {
t.args(runArguments?.split(" ") ?: listOf<String>())
}
}
tasks.named<KotlinWebpack>("wasmJsBrowserProductionRun") {
val args = runArguments?.split(" ")
?.mapIndexed { index, arg -> "arg$index=$arg" }
?.joinToString("&") ?: ""
devServerProperty = devServerProperty.get().copy(
open = "http://localhost:8080?$args"
)
}
}

2
benchmarks/multiplatform/gradle.properties

@ -6,7 +6,5 @@ compose.desktop.verbose=true
android.useAndroidX=true
runArguments=benchmarks= modes=
kotlin.js.webpack.major.version=4
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
org.jetbrains.compose.resources.multimodule.disable=true

3
benchmarks/multiplatform/iosApp/Configuration/Config.xcconfig

@ -0,0 +1,3 @@
TEAM_ID=
BUNDLE_ID=org.jetbrains.benchmarks
APP_NAME=ComposeBenchmarks

382
benchmarks/multiplatform/iosApp/iosApp.xcodeproj/project.pbxproj

@ -0,0 +1,382 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };
058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };
2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; };
7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; };
7555FF7B242A565900829871 /* ComposeBenchmarks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ComposeBenchmarks.app; sourceTree = BUILT_PRODUCTS_DIR; };
7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
F85CB1118929364A9C6EFABC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
058557D7273AAEEB004C7B11 /* Preview Content */ = {
isa = PBXGroup;
children = (
058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
7555FF72242A565900829871 = {
isa = PBXGroup;
children = (
AB1DB47929225F7C00F7AF9C /* Configuration */,
7555FF7D242A565900829871 /* iosApp */,
7555FF7C242A565900829871 /* Products */,
);
sourceTree = "<group>";
};
7555FF7C242A565900829871 /* Products */ = {
isa = PBXGroup;
children = (
7555FF7B242A565900829871 /* ComposeBenchmarks.app */,
);
name = Products;
sourceTree = "<group>";
};
7555FF7D242A565900829871 /* iosApp */ = {
isa = PBXGroup;
children = (
058557BA273AAA24004C7B11 /* Assets.xcassets */,
7555FF82242A565900829871 /* ContentView.swift */,
7555FF8C242A565B00829871 /* Info.plist */,
2152FB032600AC8F00CF470E /* iOSApp.swift */,
058557D7273AAEEB004C7B11 /* Preview Content */,
);
path = iosApp;
sourceTree = "<group>";
};
AB1DB47929225F7C00F7AF9C /* Configuration */ = {
isa = PBXGroup;
children = (
AB3632DC29227652001CCB65 /* Config.xcconfig */,
);
path = Configuration;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
7555FF7A242A565900829871 /* iosApp */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */;
buildPhases = (
05E104082A8AADF800D11C3D /* Compile Kotlin */,
7555FF77242A565900829871 /* Sources */,
7555FF79242A565900829871 /* Resources */,
F85CB1118929364A9C6EFABC /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = iosApp;
productName = iosApp;
productReference = 7555FF7B242A565900829871 /* ComposeBenchmarks.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
7555FF73242A565900829871 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1130;
LastUpgradeCheck = 1130;
ORGANIZATIONNAME = orgName;
TargetAttributes = {
7555FF7A242A565900829871 = {
CreatedOnToolsVersion = 11.3.1;
};
};
};
buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 7555FF72242A565900829871;
productRefGroup = 7555FF7C242A565900829871 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
7555FF7A242A565900829871 /* iosApp */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
7555FF79242A565900829871 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */,
058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
05E104082A8AADF800D11C3D /* Compile Kotlin */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Compile Kotlin";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd \"$SRCROOT/..\"\n./gradlew :benchmarks:embedAndSignAppleFrameworkForXcode\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
7555FF77242A565900829871 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */,
7555FF83242A565900829871 /* ContentView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
7555FFA3242A565B00829871 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
7555FFA4242A565B00829871 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
7555FFA6242A565B00829871 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = "${TEAM_ID}";
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../benchmarks/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n";
INFOPLIST_FILE = iosApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
"benchmarks\n",
);
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
PRODUCT_NAME = "${APP_NAME}";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
7555FFA7242A565B00829871 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = "${TEAM_ID}";
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../benchmarks/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n";
INFOPLIST_FILE = iosApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
"benchmarks\n",
);
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
PRODUCT_NAME = "${APP_NAME}";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7555FFA3242A565B00829871 /* Debug */,
7555FFA4242A565B00829871 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7555FFA6242A565B00829871 /* Debug */,
7555FFA7242A565B00829871 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 7555FF73242A565900829871 /* Project object */;
}

11
benchmarks/multiplatform/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

98
benchmarks/multiplatform/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json

@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

6
benchmarks/multiplatform/iosApp/iosApp/Assets.xcassets/Contents.json

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

11
benchmarks/multiplatform/iosApp/iosApp/ContentView.swift

@ -0,0 +1,11 @@
import UIKit
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text("Hello, world!")
}
.padding()
}
}

50
benchmarks/multiplatform/iosApp/iosApp/Info.plist

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
</dict>
<key>UILaunchScreen</key>
<dict/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

6
benchmarks/multiplatform/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

15
benchmarks/multiplatform/iosApp/iosApp/iOSApp.swift

@ -0,0 +1,15 @@
import SwiftUI
import benchmarks
@main
struct iOSApp: App {
init() {
Main_iosKt.main(args: ProcessInfo.processInfo.arguments)
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}

2
benchmarks/multiplatform/settings.gradle.kts

@ -17,3 +17,5 @@ pluginManagement {
}
rootProject.name = "compose-benchmarks"
include(":benchmarks")

68
benchmarks/multiplatform/src/macosMain/kotlin/main.macos.kt

@ -1,68 +0,0 @@
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.objcPtr
import kotlinx.coroutines.runBlocking
import org.jetbrains.skia.*
import platform.Metal.*
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
/*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
@OptIn(ExperimentalForeignApi::class)
fun main(args : Array<String>) {
Args.parseArgs(args)
val graphicsContext = object : GraphicsContext {
private val device = MTLCreateSystemDefaultDevice() ?: throw IllegalStateException("Can't create MTLDevice")
private val commandQueue = device.newCommandQueue() ?: throw IllegalStateException("Can't create MTLCommandQueue")
private val directContext = DirectContext.makeMetal(device.objcPtr(), commandQueue.objcPtr())
private var cachedSurface: Surface? = null
override fun surface(width: Int, height: Int): Surface {
val oldSurface = cachedSurface
if (oldSurface != null && oldSurface.width == width && oldSurface.height == height) {
return oldSurface
}
val descriptor = MTLTextureDescriptor()
descriptor.width = width.toULong()
descriptor.height = height.toULong()
descriptor.usage = MTLTextureUsageShaderRead or MTLTextureUsageShaderWrite or MTLTextureUsageRenderTarget
descriptor.textureType = MTLTextureType2D
descriptor.pixelFormat = MTLPixelFormatBGRA8Unorm
descriptor.mipmapLevelCount = 1UL
val texture = device.newTextureWithDescriptor(descriptor) ?: throw IllegalStateException("Can't create MTLTexture")
val renderTarget = BackendRenderTarget.makeMetal(width, height, texture.objcPtr())
return Surface.makeFromBackendRenderTarget(
directContext,
renderTarget,
SurfaceOrigin.TOP_LEFT,
SurfaceColorFormat.BGRA_8888,
ColorSpace.sRGB,
SurfaceProps(pixelGeometry = PixelGeometry.UNKNOWN)
).also {
cachedSurface = it
} ?: throw IllegalStateException("Can't create Surface")
}
override suspend fun awaitGPUCompletion() {
val commandBuffer = commandQueue.commandBuffer() ?: return
suspendCoroutine { continuation ->
commandBuffer.addCompletedHandler {
continuation.resume(Unit)
}
commandBuffer.commit()
}
}
}
runBlocking { runBenchmarks(graphicsContext = graphicsContext)}
}
Loading…
Cancel
Save