8#ifndef GrMtlUtil_DEFINED
9#define GrMtlUtil_DEFINED
11#import <Metal/Metal.h>
25 struct ProgramSettings;
37#if __has_feature(objc_arc)
38 return (__bridge id<MTLTexture>)mtlTexture;
40 return (id<MTLTexture>)mtlTexture;
48#if __has_feature(objc_arc)
49 return (__bridge
const void*)idObject;
51 return (
const void*)idObject;
60 return CFBridgingRetain(idObject);
79 const std::string& msl,
87 const std::string& msl);
93 MTLCompileOptions*, NSError**);
99 id<MTLDevice>, MTLRenderPipelineDescriptor*, NSError**);
MTLTextureDescriptor * GrGetMTLTextureDescriptor(id< MTLTexture > mtlTexture)
GrColorFormatDesc GrMtlFormatDesc(MTLPixelFormat)
id< MTLRenderPipelineState > GrMtlNewRenderPipelineStateWithDescriptor(id< MTLDevice >, MTLRenderPipelineDescriptor *, NSError **)
int GrMtlFormatStencilBits(MTLPixelFormat)
void GrPrecompileMtlShaderLibrary(const GrMtlGpu *gpu, const std::string &msl)
static MTLPixelFormat GrBackendFormatAsMTLPixelFormat(const GrBackendFormat &format)
SK_ALWAYS_INLINE CF_RETURNS_RETAINED const void * GrRetainPtrFromId(id idObject)
SkTextureCompressionType GrMtlFormatToCompressionType(MTLPixelFormat)
id< MTLLibrary > GrMtlNewLibraryWithSource(id< MTLDevice >, NSString *mslCode, MTLCompileOptions *, NSError **)
NSError * GrCreateMtlError(NSString *description, GrMtlErrorCode errorCode)
SK_ALWAYS_INLINE const void * GrGetPtrFromId(id idObject)
id< MTLTexture > GrGetMTLTextureFromSurface(GrSurface *surface)
GR_NORETAIN_BEGIN SK_ALWAYS_INLINE id< MTLTexture > GrGetMTLTexture(const void *mtlTexture)
id< MTLLibrary > GrCompileMtlShaderLibrary(const GrMtlGpu *gpu, const std::string &msl, GrContextOptions::ShaderErrorHandler *errorHandler)
uint32_t uint32_t * format