File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
benchmarks/multiplatform/benchmarks/src/appleMain/kotlin Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,8 @@ fun graphicsContext() = object : GraphicsContext {
2323 private val device = MTLCreateSystemDefaultDevice () ? : throw IllegalStateException (" Can't create MTLDevice" )
2424 private val commandQueue = device.newCommandQueue() ? : throw IllegalStateException (" Can't create MTLCommandQueue" )
2525 private val directContext = DirectContext .makeMetal(device.objcPtr(), commandQueue.objcPtr())
26- private var cachedSurface: Surface ? = null
2726
2827 override fun surface (width : Int , height : Int ): Surface {
29- val oldSurface = cachedSurface
30-
31- if (oldSurface != null && oldSurface.width == width && oldSurface.height == height) {
32- return oldSurface
33- }
34-
3528 val descriptor = MTLTextureDescriptor ()
3629 descriptor.width = width.toULong()
3730 descriptor.height = height.toULong()
@@ -51,9 +44,7 @@ fun graphicsContext() = object : GraphicsContext {
5144 SurfaceColorFormat .BGRA_8888 ,
5245 ColorSpace .sRGB,
5346 SurfaceProps (pixelGeometry = PixelGeometry .UNKNOWN )
54- ).also {
55- cachedSurface = it
56- } ? : throw IllegalStateException (" Can't create Surface" )
47+ ) ? : throw IllegalStateException (" Can't create Surface" )
5748 }
5849
5950 override suspend fun awaitGPUCompletion () {
You can’t perform that action at this time.
0 commit comments