
Metal Resources MTLBuffer : 모든 데이터 타입을 포함하 ㄹ수 있는 unformatted 메모리 할당 MTLTexture : formatted 이미지 데이터 할당 Argument Table Shader Parameters와 Resources 사이의 매핑 (Encoder와 Shader 사이의 연결) Buffers Textures Sampler states Buffer Buffer 생성 makeBuffer(length:options:) makeBuffer(bytes:length:options:) makeBuffer(bytesNoCopy:length:options:deallocator:) MTLVertexDescriptor vertexDescriptor.attributes[0].offset..

MSL은 Vector와 Matrix에 대한 데이터 타입을 갖고 있다. ex) float3, float4, float4x4 Argument Table Shader 작성 방법 shaderType returnType shaderName(parameter1, parameter2, etc....) { .. } shaderType : vertex, fragment, kernel Vertex Shader 셋팅 // generate a large enough buffer to allow streaming vertices for 3 // semaphore controlled frames vertexBuffer = device.makeBuffer(length: ConstantBufferSize, options: []) v..
let options = [CIImageOption.colorSpace: CGColorSpaceCreateDeviceRGB()] as [CIImageOption: Any] let image = CIImage.init(mtlTexture: texture, options: options) option에 CGColorSpaceCreateDeviceRGB()를 추가한다. https://stackoverflow.com/questions/51792808/ios-color-space-metal-texture-to-ui-image-iphone-vs-ipad-camera
https://navoshta.com/metal-camera-part-1-camera-session/ Metal Camera Tutorial Part 1: Getting raw camera data A lot of apps nowadays use iPhone and iPad cameras. Some even do pretty badass things with it (performance wise), like running each frame through a neural network or applying a realtime filter. Either way you may want to get as low as you can in terms of t navoshta.com Getting raw camer..