1 /* 2 * Copyright 2021 Google LLC 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef skgpu_MtlUtils_DEFINED 9 #define skgpu_MtlUtils_DEFINED 10 11 #include "experimental/graphite/src/ResourceTypes.h" 12 #include "include/core/SkImageInfo.h" 13 #include "include/ports/SkCFObject.h" 14 15 #import <Metal/Metal.h> 16 17 namespace SkSL { 18 class String; 19 } 20 21 namespace skgpu::mtl { 22 23 class Gpu; 24 25 bool FormatIsDepthOrStencil(MTLPixelFormat); 26 27 MTLPixelFormat SkColorTypeToFormat(SkColorType); 28 29 MTLPixelFormat DepthStencilTypeToFormat(DepthStencilType); 30 31 sk_cfp<id<MTLLibrary>> CompileShaderLibrary(const Gpu* gpu, 32 const SkSL::String& msl); 33 34 } // namespace skgpu::mtl 35 36 #endif // skgpu_MtlUtils_DEFINED 37