飛び道具ではないmetal #iosdc

Post on 22-Jan-2018

4.065 Views

Category:

Mobile

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

iOSDC 2017

Shuichi Tsutsumi shu223

WWDC 2014

Swift Metal

WWDC2014 Metal

WWDC2014 Swift

Metal

Metal

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

bull Core Animationbull UIKit

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

WWDC 2014

Swift Metal

WWDC2014 Metal

WWDC2014 Swift

Metal

Metal

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

bull Core Animationbull UIKit

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Swift Metal

WWDC2014 Metal

WWDC2014 Swift

Metal

Metal

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

bull Core Animationbull UIKit

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

WWDC2014 Metal

WWDC2014 Swift

Metal

Metal

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

bull Core Animationbull UIKit

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

WWDC2014 Swift

Metal

Metal

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

bull Core Animationbull UIKit

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Metal

Metal

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

bull Core Animationbull UIKit

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Metal

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

bull Core Animationbull UIKit

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

bull Core Animationbull UIKit

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Metal

GPU

bull Core MLbull Visionbull Core Imagebull SceneKitbull SpriteKitbull MapKit

bull Core Animationbull UIKit

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

143000Metal API

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

143000

17000000Metal API

Metal API

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Metal

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Metal

Metal

Metal

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

imageViewimage = image

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

CPU GPU

CPUbull

bull

GPUbull

bull CPU

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

bull CPU

- 100

bull GPU GPU

-

-

-

-

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

1 60

bull CPUbull

OK

1

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

1 60

bull CPUbull

OK

GPU

1

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

GPU GPU

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

GPU

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

GPU

GPU

Your app

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

OpenGL

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

OpenGLbull API

bull

bull Apple

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Metalbull Apple

bull Apple

bull OpenGL 10

bull OpenGL Metal

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

imageViewimage = image

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Metal API

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

bull MTLDevice bull MTLCommandQueue bull MTLCommandBuffer bull MTLCommandEncoder bull MTLTexture bull MTKView bull MTKTextureLoader bull etchellip

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

$

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTLCommandEncoder

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLCommandBuffer

MTLTexture

MTLDevice

MTLCommandQueue

MTKTextureLoader

MTLCommandEncoder

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLDevice

let device = MTLCreateSystemDefaultDevice()

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLTexture MTKTextureLoader

loader = MTKTextureLoader(device device) texture = try loadernewTexture( name ldquohoge scaleFactor viewcontentScaleFactor bundle nil)

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLCommandQueue MTLCommandBuffer

let commandBuffer = commandQueuemakeCommandBuffer()

hellip

commandBuffercommit()

commandQueue = devicemakeCommandQueue()

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLCommandEncoderbull

MTLRenderCommandEncoder

MTLComputeCommandEncoder

MTLBlitCommandEncode

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

MTLCommandEncoder (MTLBlitCommandEncoder)

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

let commandBuffer = commandQueuemakeCommandBuffer()

let blitEncoder = commandBuffermakeBlitCommandEncoder() blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin srcOrigin sourceSize srcSize to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigindstOrigin) blitEncoderendEncoding()

commandBuffercommit()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

private let device = MTLCreateSystemDefaultDevice() private func setup() commandQueue = devicemakeCommandQueue() let textureLoader = MTKTextureLoader(device device) texture = try textureLoadernewTexture(name highsierra scaleFactor viewcontentScaleFactor bundle nil) mtkViewdevice = device mtkViewdelegate = self mtkViewcolorPixelFormat = texturepixelFormat

rarr rarr GPU

rarr GPU

rarr

func draw(in view MTKView) guard let drawable = viewcurrentDrawable else return guard let commandBuffer = commandQueuemakeCommandBuffer() else fatalError() guard let blitEncoder = commandBuffermakeBlitCommandEncoder() else fatalError() let targetW = min(texturewidth drawabletexturewidth) let targetH = min(textureheight drawabletextureheight) blitEncodercopy(from texture sourceSlice 0 sourceLevel 0 sourceOrigin MTLOrigin(x 0 y 0 z 0) sourceSize MTLSizeMake(targetW targetH texturedepth) to drawabletexture destinationSlice 0 destinationLevel 0 destinationOrigin MTLOrigin(x 0 y 0 z 0)) blitEncoderendEncoding() commandBufferpresent(drawable) commandBuffercommit() commandBufferwaitUntilCompleted()

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Powered by

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

GPU

GPU

Your app

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

Metalbull ARKit

bull MPS CNN RNN

bull Core Image

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

GPU Metal

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

bull Metal - UIKit

bull GPU GPU

bull Metal - Metal OpenGL

bull Metal -

httpsgithubcomshu223

httpsgithubcomshu223

top related