Metal Framework

Horus-iOS·2022년 5월 27일
0

Metal

https://developer.apple.com/kr/metal/


Metal

https://developer.apple.com/documentation/metal/

역시 좋은 소리만 다 써놨네.

MetalKit은 작업을 단순화 해준댄다.

Metal Performance Shaders 프레임워크는 각 GPU의 고유 하드웨어로부터 최적화된 연산과 렌더링 셰이더(쉐이더가 맞냐 셰이더가 맞냐)와 관련이 있는 거대한 라이브러리를 제공한댄다.

메탈과 관련이 있는(메탈이 상위인) 하이 레벨 프레임워크들은 성능 측면에서 효율이 좋댄다 (e.g., SpriteKit, SceneKit, RealityKit, Core Image 등).

커스텀 할라면 아래 링크(Metal Shading Language Specification) 가보란다.

가보니까 안 가보는게 좋았다.

Metal Shading Language Specification

https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf

C++ 14 기반의 Metal Shading 언어.

타입, 함수 및 변수 선언, 연산 등을 보여주고 있다.

이 문서는 한 번 다 읽기보다 커스텀 사용(할지도 안 할지도 모르지만) 시 필요할 때마다 찾아보는 것이 낫겠다 마치 사전처럼.

Metal Feature Set Tables

https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf

무얼 정리했는지도 아직 잘 모르겠는 것인데, 정말 말 그대로 테이블이긴 하다.

MetalKit

https://developer.apple.com/documentation/metalkit/

하위에 MTKView, MTKViewDelegate, MTKTextureLoader, MTKMesh 등이 있다.

MTL이 아님에 유의하자 여기는 메탈'킷'이다.

Metal Performance Shaders

https://developer.apple.com/documentation/metalperformanceshaders/

번역글은 아래 링크.

https://velog.io/@horus222128/Metal-Performance-Shaders

셰이더가 무엇인지 알아봐야 한다.

그리고 이 글의 하위에 등장하는 것들.

Optimizing Performance with the GPU Counters Instrument

https://developer.apple.com/documentation/metal/performance_tuning/optimizing_performance_with_the_gpu_counters_instrument?preferredLanguage=occ

매우 중요해 보인다 어떻게 정리할지 생각해야 한다.

Enabling Frame Capture

https://developer.apple.com/documentation/metal/debugging_tools/enabling_frame_capture?preferredLanguage=occ

개발 환경 설정과 관련이 있다 프레임 캡처 관련인듯 하다.

Reducing the Memory Footprint of Metal Apps

https://developer.apple.com/documentation/metal/resource_fundamentals/reducing_the_memory_footprint_of_metal_apps

이 글의 하위에 아래 링크가 담겨있다 메탈 디버거, 메탈 시스템 트레이스에 대해 소개한다.

Gain insights into your Metal app with Xcode 12
https://developer.apple.com/videos/play/wwdc2020/10605/

영상의 마지막에는 Next steps로 아래 내용을 소개한다.

  • Optimize Metal Apps and Games with GPU Counters (WWDC20)
  • Debug GPU-side errors in Metal (WWDC20)
  • Harness Apple GPUs with Metal (WWDC20)
  • Delivering Optimized Metal Apps and Games (WWDC19)
  • Metal Shader Debugging and Profiling (WWDC18)
  • Metal 2 Optimization and Debugging (WWDC17)

MTLCreateSystemDefaultDevice()

Returns the device instance Metal selects as the default.

메탈이 기본값으로 선택한 디바이스 인스턴스를 반환합니다.

https://velog.io/@horus222128/MTLCreateSystemDefaultDevice

MTLComputePipelineState

An object that contains a compiled compute pipeline.

컴파일된 연산 파이프라인을 포함하고 있는 객체입니다.

https://velog.io/@horus222128/MTLComputePipelineState

MTLTexture

A resource that holds formatted image data.

포맷화된 이미지 데이터를 갖고 있는 리소스입니다.

https://velog.io/@horus222128/MTLTexture

MTLBuffer

A resource that stores data in a format defined by your app.

앱에서 정의하고 있는 포맷으로 데이터를 저장하고 있는 리소스입니다.

https://developer.apple.com/documentation/metal/mtlbuffer

MTLCommandBuffer

A container that stores encoded commands for the GPU to execute.

GPU가 수행할 인코딩된 커맨드를 저장하는 컨테이너입니다.

https://velog.io/@horus222128/MTLCommandBuffer

MTLRenderPipelineDescriptor

An argument of options you pass to a device to get a render pipeline state object.

렌더 파이프라인 상태 객체를 가져오기 위해 디바이스로 보내는 옵션의 인자입니다.

미디어 관련 프레임워크들을 다루면서 'descriptor'가 끝에 붙는 객체들이 많이 보인다. 샘플 버퍼 등 어떠한 것의 특성을 파악하기 위해 사용하거나, 어떤 행동을 할 때 해당 행동의 특성을 지정할 수 있는 등의 기능을 하는 것 같다.

https://velog.io/@horus222128/MTLRenderPipelineDescriptor

MTLSamplerDescriptor

An object that you use to configure a texture sampler.

텍스처 샘플러를 설정하기 위해 사용하는 객체입니다.

위에서 적은 내용처럼 'descriptor'는 어떤 행동을 할 때 특성을 지정할 수 있도록 돕는 객체이다. MTLSamplerDescriptor는 설정된 특성으로 샘플러를 생성할 수 있도록 해준다.

https://velog.io/@horus222128/MTLSamplerDescriptor

MTLRenderPipelineState

An object that contains graphics functions and configuration state to use in a render command.

렌더 커맨드에서 사용하기 위한 그래픽 함수 및 설정 상태를 포함하는 객체입니다.

아직 잘 와닿지 않는다.

https://velog.io/@horus222128/MTLRenderPipelineState

MTLSamplerState

An object that defines how a texture should be sampled.

텍스처가 어떻게 샘플되어야 하는지 정의하는 객체입니다.

https://velog.io/@horus222128/MTLSamplerState

0개의 댓글